pub struct EntityBlock {
pub entity_type: EntityType,
pub id: TemporalId,
pub payload_len: u32,
pub payload: Vec<u8>,
}Expand description
Entity block — wraps a serialized temporal entity.
Fields§
§entity_type: EntityTypeEntity type.
id: TemporalIdEntity ID.
payload_len: u32Payload length.
payload: Vec<u8>Payload (JSON-serialized entity).
Implementations§
Source§impl EntityBlock
impl EntityBlock
Sourcepub fn new<T: Serialize>(
entity_type: EntityType,
id: TemporalId,
entity: &T,
) -> TimeResult<Self>
pub fn new<T: Serialize>( entity_type: EntityType, id: TemporalId, entity: &T, ) -> TimeResult<Self>
Create a new entity block from a serializable entity.
Sourcepub fn read_from<R: Read>(reader: &mut R) -> TimeResult<Self>
pub fn read_from<R: Read>(reader: &mut R) -> TimeResult<Self>
Read block from a reader.
Sourcepub fn deserialize<T: for<'de> Deserialize<'de>>(&self) -> TimeResult<T>
pub fn deserialize<T: for<'de> Deserialize<'de>>(&self) -> TimeResult<T>
Deserialize payload into a typed entity.
Trait Implementations§
Source§impl Clone for EntityBlock
impl Clone for EntityBlock
Source§fn clone(&self) -> EntityBlock
fn clone(&self) -> EntityBlock
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EntityBlock
impl RefUnwindSafe for EntityBlock
impl Send for EntityBlock
impl Sync for EntityBlock
impl Unpin for EntityBlock
impl UnsafeUnpin for EntityBlock
impl UnwindSafe for EntityBlock
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more