pub enum MessageResult {
Close,
ExpectMsgSize(usize),
DropMsgSize(usize),
}
Expand description
MessageResult
is returned by on_inbound_message
to indicate result.
Variants§
Close
Error or close. Exit message reading and close socket.
ExpectMsgSize(usize)
Expecting more read, indicating decoded/expected message size. If it’s non-zero, on_inbound_message`` will not be called until full message is read; if it's 0, meaning the message size is unknown,
on_inbound_message` will be called everytime when there are any bytes read.
- Note that when calling on_inbound_message(decoded_msg_size) -> ExpectMsgSize(expect_msg_size), if expect_msg_size!=0, it should be always > msg_size.
DropMsgSize(usize)
msg has been processed, indicating bytes to drop.
Auto Trait Implementations§
impl Freeze for MessageResult
impl RefUnwindSafe for MessageResult
impl Send for MessageResult
impl Sync for MessageResult
impl Unpin for MessageResult
impl UnwindSafe for MessageResult
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