pub struct OutMessage { /* private fields */ }Expand description
A whole message to send: its bytes, with large octet sequences that were not copied in kept apart.
Implementations§
Source§impl OutMessage
impl OutMessage
Sourcepub fn slices_from(&self, from: usize, max: usize) -> Vec<IoSlice<'_>>
pub fn slices_from(&self, from: usize, max: usize) -> Vec<IoSlice<'_>>
The pieces of the message from offset from on, in order, for a
vectored write; at most max of them.
Sourcepub fn fragment(self, size: usize) -> OutMessage
pub fn fragment(self, size: usize) -> OutMessage
Splits a GIOP 1.2 Request, Reply or LocateReply longer than
size bytes into a first message and Fragment messages of at
most size bytes each (size rounded down to a multiple of 8, at
least 64), returned one after the other in one OutMessage. Other
messages, and messages that fit, are returned as they are.
The first message keeps the whole message-specific header. Every
message but the last is a multiple of 8 bytes long, so the body
keeps its alignment whether it is read relative to the start of
the whole message or of each Fragment (16 bytes of headers).
Sourcepub fn with_reply_header(
self,
header: &ReplyHeader,
) -> Result<OutMessage, OutMessage>
pub fn with_reply_header( self, header: &ReplyHeader, ) -> Result<OutMessage, OutMessage>
The same Reply (made with MessageEncoder::reply) with the
message-specific header header instead, for service contexts that
are known only once the body has been written. The body is kept as
it is: in GIOP 1.2 it starts on an 8-byte boundary after the
header, so it does not depend on the header’s length. Before GIOP
1.2 it follows the header directly and is aligned from the start of
the message, so a header whose length differs by other than a
multiple of 8 would misalign it: then Err returns the message
unchanged.