Trait netservices::frame::Frame
source · pub trait Frame: Send + Sized {
type Error: Error + Send;
fn unmarshall(reader: impl Read) -> Result<Option<Self>, Self::Error>;
fn marshall(&self, writer: impl Write) -> Result<usize, Self::Error>;
}
Required Associated Types§
Required Methods§
sourcefn unmarshall(reader: impl Read) -> Result<Option<Self>, Self::Error>
fn unmarshall(reader: impl Read) -> Result<Option<Self>, Self::Error>
Reads frame from the stream.
If the stream doesn’t contain the whole message yet must return Ok(None)