pub struct MessageWriter { /* private fields */ }Expand description
SocketWriter is a wrapper around the writable half of a tokio stream and a buffer which will be dumped into that stream.
Implementations§
Source§impl MessageWriter
impl MessageWriter
pub fn new( buffer_size: usize, max_message_size: usize, max_chunk_count: usize, ) -> MessageWriter
pub fn write_ack(&mut self, ack: &AcknowledgeMessage) -> EncodingResult<usize>
Sourcepub fn write(
&mut self,
request_id: u32,
message: SupportedMessage,
secure_channel: &SecureChannel,
) -> Result<u32, StatusCode>
pub fn write( &mut self, request_id: u32, message: SupportedMessage, secure_channel: &SecureChannel, ) -> Result<u32, StatusCode>
Encodes the message into a series of chunks, encrypts those chunks and writes the result into the buffer ready to be sent.
pub fn next_request_id(&mut self) -> u32
Sourcepub fn bytes_to_write(&mut self) -> Vec<u8> ⓘ
pub fn bytes_to_write(&mut self) -> Vec<u8> ⓘ
Yields any results to write, resetting the buffer back afterwards
Auto Trait Implementations§
impl Freeze for MessageWriter
impl RefUnwindSafe for MessageWriter
impl Send for MessageWriter
impl Sync for MessageWriter
impl Unpin for MessageWriter
impl UnsafeUnpin for MessageWriter
impl UnwindSafe for MessageWriter
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