Trait spectrusty_core::bus::SerializeDynDevice
source · pub trait SerializeDynDevice {
fn serialize_dyn_device<T: TimestampOps + Serialize + 'static, S: Serializer>(
device: &Box<dyn NamedBusDevice<T>>,
serializer: S
) -> Result<S::Ok, S::Error>;
}
Expand description
This trait needs to be implemented by a type provided to DynamicSerdeBus as a parameter S
,
to serialize dynamic devices.
Required Methods§
sourcefn serialize_dyn_device<T: TimestampOps + Serialize + 'static, S: Serializer>(
device: &Box<dyn NamedBusDevice<T>>,
serializer: S
) -> Result<S::Ok, S::Error>
fn serialize_dyn_device<T: TimestampOps + Serialize + 'static, S: Serializer>(
device: &Box<dyn NamedBusDevice<T>>,
serializer: S
) -> Result<S::Ok, S::Error>
This function should serialize the provided dynamic device.
The serialized form of the device
depends completely on the implementation of this function,
however it should probably include some device identifier along with the device data.