pub struct ProtocolFrame(Bytes);Expand description
Owned muxr protocol frame bytes.
This intentionally wraps [Bytes] instead of exposing it directly from the encoder API: muxr keeps a domain-owned
protocol type at the core boundary, while transports can still take the Bytes buffer without copying the payload.
Tuple Fields§
§0: BytesImplementations§
Source§impl ProtocolFrame
impl ProtocolFrame
pub fn as_bytes(&self) -> &[u8] ⓘ
pub fn into_bytes(self) -> Bytes
fn from_payload(kind: ProtocolFrameKind, payload: &[u8]) -> Self
Trait Implementations§
Source§impl AsRef<[u8]> for ProtocolFrame
impl AsRef<[u8]> for ProtocolFrame
Source§impl Clone for ProtocolFrame
impl Clone for ProtocolFrame
Source§fn clone(&self) -> ProtocolFrame
fn clone(&self) -> ProtocolFrame
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProtocolFrame
impl Debug for ProtocolFrame
impl Eq for ProtocolFrame
Source§impl From<&[u8]> for ProtocolFrame
Frames raw rkyv payload bytes by prepending muxr’s frame kind.
impl From<&[u8]> for ProtocolFrame
Frames raw rkyv payload bytes by prepending muxr’s frame kind.
Source§impl PartialEq for ProtocolFrame
impl PartialEq for ProtocolFrame
impl StructuralPartialEq for ProtocolFrame
Source§impl TryFrom<&ClientRequest> for ProtocolFrame
impl TryFrom<&ClientRequest> for ProtocolFrame
Source§impl TryFrom<&ServerEvent> for ProtocolFrame
impl TryFrom<&ServerEvent> for ProtocolFrame
Auto Trait Implementations§
impl !Freeze for ProtocolFrame
impl RefUnwindSafe for ProtocolFrame
impl Send for ProtocolFrame
impl Sync for ProtocolFrame
impl Unpin for ProtocolFrame
impl UnsafeUnpin for ProtocolFrame
impl UnwindSafe for ProtocolFrame
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.