pub enum TransportEvent {
Frame(String),
Ping(Vec<u8>),
Pong(Vec<u8>),
}Expand description
One thing read off a transport: a complete OCPP-J text frame, or a protocol-level
keepalive event. Carrying ping/pong through the abstraction (rather than hiding it
entirely inside the WebSocket adapter) keeps send_ping/on_ping possible without the
generic client knowing anything WebSocket-specific.
Ping/Pong carry the frame’s application data, which RFC 6455 §5.5.2-3 requires a pong
to echo back from the ping that triggered it. Client relies on that echo to match a pong
to the exact send_ping waiting for it, so transport implementations must pass the payload
through rather than discarding it.
Variants§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TransportEvent
impl RefUnwindSafe for TransportEvent
impl Send for TransportEvent
impl Sync for TransportEvent
impl Unpin for TransportEvent
impl UnsafeUnpin for TransportEvent
impl UnwindSafe for TransportEvent
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