[][src]Trait packs::structure::packable_struct::PackableStruct

pub trait PackableStruct: Sized {
    const FIELDS: usize;

    fn read_structure_body<T: Read>(reader: &mut T) -> Result<Self, DecodeError>;
fn write_structure_body<T: Write>(
        &self,
        writer: &mut T
    ) -> Result<usize, EncodeError>; }

Denotes a struct which can be encoded and decoded using encode_struct and decode_struct.

Implementation

This trait can be derived using #[derive(PackableStruct)] if all fields implement Pack and Unpack and there are at most 15 fields. This is the recommend way of using this trait.

For a valid implementation in the context of PackStream, the limit of 15 fields must not be exceeded.

Associated Constants

const FIELDS: usize

Loading content...

Required methods

fn read_structure_body<T: Read>(reader: &mut T) -> Result<Self, DecodeError>

fn write_structure_body<T: Write>(
    &self,
    writer: &mut T
) -> Result<usize, EncodeError>

Loading content...

Implementors

impl PackableStruct for Date[src]

impl PackableStruct for DateTime[src]

impl PackableStruct for DateTimeZoneId[src]

impl PackableStruct for Duration[src]

impl PackableStruct for LocalDateTime[src]

impl PackableStruct for LocalTime[src]

impl PackableStruct for Node[src]

impl PackableStruct for Path[src]

impl PackableStruct for Point2D[src]

impl PackableStruct for Point3D[src]

impl PackableStruct for Relationship[src]

impl PackableStruct for Time[src]

impl PackableStruct for UnboundRelationship[src]

Loading content...