pub trait MetaDataType<'a, M, C> where
    Self: Sized,
    M: MetaDataType<'a, M, C>,
    C: ContentType<'a, M, C>, 
{ type SendContext: ContextType; type ReceiveContext: ContextType; fn send(
        self,
        stream: &mut TcpStream,
        context: Option<Self::SendContext>
    ) -> Result<Option<<C as ContentType<'a, M, C>>::SendContext>, Error>; fn receive(
        stream: &mut TcpStream,
        context: &Option<Self::ReceiveContext>
    ) -> Result<(Self, Option<<C as ContentType<'a, M, C>>::ReceiveContext>), Error>; }
Expand description

Trait that needs to be implemented for type that will be used as metadata inside a message.

Required Associated Types

Required Methods

Send method used to send metadata inside TcpMessage::send.

Defines how are metadata send.

Returns an Option of ContentType::SendContext on associated C that is passed into ContentType::send in TcpMessage::send. or an Error if not.

Arguments

Receive method used to receive metadata inside TcpMessage::receive.

Defines how metadata are received.

Returns a tuple of Self and an Option of ContentType::ReceiveContext on associated C that is passed into ContentType::receive in TcpMessage::send if successful or an Error if not.

Arguments

Implementors