pub struct TaggedMessage {
pub now: Instant,
pub message: Message,
}Expand description
A Message together with the instant the caller is sending it at.
Rin is a TaggedBytesMut, which carries a timestamp; without this the write channel
would not, and handle_write would have to ask the clock for one. A STUN client’s first
action is typically a write before any read, so a retained instant is not an option here —
it would still be the construction seed.
Fields§
§now: InstantWhen the caller is sending this message.
message: MessageThe STUN message to send.
Trait Implementations§
Source§impl Protocol<TransportMessage<BytesMut>, TaggedMessage, ()> for Client
impl Protocol<TransportMessage<BytesMut>, TaggedMessage, ()> for Client
Source§fn poll_write(&mut self) -> Option<Self::Wout>
fn poll_write(&mut self) -> Option<Self::Wout>
Returns packets to transmit
It should be polled for transmit after:
- the application performed some I/O
- a call was made to
handle_read - a call was made to
handle_write - a call was made to
handle_timeout
Source§fn handle_read(&mut self, msg: TaggedBytesMut) -> Result<()>
fn handle_read(&mut self, msg: TaggedBytesMut) -> Result<()>
Handle an incoming read message. Read more
Source§fn handle_write(&mut self, msg: TaggedMessage) -> Result<()>
fn handle_write(&mut self, msg: TaggedMessage) -> Result<()>
Handle an outgoing write message. Read more
Auto Trait Implementations§
impl Freeze for TaggedMessage
impl RefUnwindSafe for TaggedMessage
impl Send for TaggedMessage
impl Sync for TaggedMessage
impl Unpin for TaggedMessage
impl UnsafeUnpin for TaggedMessage
impl UnwindSafe for TaggedMessage
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