pub trait ICompositorSerializable {
// Required methods
fn try_get_server(&self, c: &Compositor) -> Option<ServerObjectId>;
fn serialize_changes(
&self,
c: &Compositor,
writer: &mut BatchStreamWriter<'_>,
);
// Provided methods
fn serialization_key(&self) -> *const () { ... }
fn prepare_serialization(&self, _c: &Compositor) { ... }
}Expand description
An object whose changes are serialized into the next batch of a compositor.
Required Methods§
Sourcefn try_get_server(&self, c: &Compositor) -> Option<ServerObjectId>
fn try_get_server(&self, c: &Compositor) -> Option<ServerObjectId>
The server-side counterpart of the object on compositor c, if it
has one.
Sourcefn serialize_changes(&self, c: &Compositor, writer: &mut BatchStreamWriter<'_>)
fn serialize_changes(&self, c: &Compositor, writer: &mut BatchStreamWriter<'_>)
Writes the pending changes of the object for compositor c.
Provided Methods§
Sourcefn serialization_key(&self) -> *const ()
fn serialization_key(&self) -> *const ()
The identity of the object, by which a compositor avoids queueing it twice. The default is the address of the implementing value; an adapter around an object returns the identity of that object.
Sourcefn prepare_serialization(&self, _c: &Compositor)
fn prepare_serialization(&self, _c: &Compositor)
Called before the changes of the object are written for compositor
c.
A server object is referred to by its id and created by the batch itself, so an object whose changes refer to server objects that only come to exist while it is serialized (the recorded content of a scene brush) creates them here: their creation is then written before the changes that refer to them.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".