pub trait ValueState: Send + 'static {
// Required methods
fn info(&self) -> &'static ValueInfo;
fn write_state(&self, out: &mut OutStream<'_>) -> Sys<()>;
fn read_state(&mut self, input: &mut InStream<'_>) -> Sys<()>;
fn view(&self, ty: TypeId) -> Option<&dyn Any>;
fn view_mut(&mut self, ty: TypeId) -> Option<&mut dyn Any>;
}Expand description
The state of a valuetype instance: the struct the generator makes for each valuetype, with the state of its base type as a member.
Required Methods§
Sourcefn write_state(&self, out: &mut OutStream<'_>) -> Sys<()>
fn write_state(&self, out: &mut OutStream<'_>) -> Sys<()>
Writes the state members, those of the base types first.
Sourcefn read_state(&mut self, input: &mut InStream<'_>) -> Sys<()>
fn read_state(&mut self, input: &mut InStream<'_>) -> Sys<()>
Reads the state members, those of the base types first.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".