'Sure. My apologies, the vagueness reflects my knowledge level. It's a managerial question to low level programmers about dynamic (external language) programming.
Repharased, I was thinking of types created in external libraries or other environments where the size is unknown to Rust.
Is the best practice to create a trait?
For example the trait in turn could make an unsafe (external to Rust) call to the other environment to query the size of the type. I could pull it (size) out of the data too potentially.
Can I assume all this controversy over the size of ALL types, external in particular, is resolved? I could not find where it was. I can't imagine how it could be.
CONTEXT:
I need to handle objects both local and passed over networks and from exotic environments (PICK for example.)
My top candidates for crates (ie provisionally. I will add the links today) is:
A C string is as long as the
number of characters
between the beginning
of the string and the
terminating null character
(without including the
terminating null
character itself).
Represents ".len()" and is a LINT due to it's idiotic performance cost.
I love fat pointers as they are more frame / object friendly.
I view them as analogs to object in C# given they can be extended.
Another analog is macros. I prototyped a (working) mutlivalued objects / fields as operator overloads. (Extended the language.)
My point being that (macros) is how you extend syntax here and operators are available.
And while both are highly optimized Rust is uniquely designed (zero cost no GC)
It mercifully lacks DotNet but... give it time. Probably a crate already.
Footnote: C# strings another non-issue. I this author:
Knowledgeable enough to say this:
Instead, expose the CLR free method like so...
Paid a big performance hit by not making a C friendly fat pointer on the c# side. It was supposed to be general advice and he works with frames of data. Equally true of buffers say.
So I lack issues so far where external objects are concerned. That could be ignorance talking though.
Cross-language cooperation is always going to be hard. Rust (will) offers extern type to create opaque types that Rust knows nothing about (unknown size, unknown alignment), and you're in charge of getting and using any information required to use them from FFI.
Custom dynamically sized types are planned eventually, but are very thorny to specify, so are a ways off yet as closer improvements are of higher importance currently (2019 was chosen to be a year for maturity, after all).
It feels like you're just starting with Rust. I'd definitely focus on working solely within Rust first, and getting help on urlo, discord, or the subreddit when you get stuck. Very few things are actually unsized in Rust currently: it's basically fat pointers for slices (&[T] is roughly (ptr, len)) and trait objects (&dyn T is roughly (ptr, &vtable)). Everything else is currently monomorphized such that size/alignment/etc is statically known.