pub struct ExtensionRef<'a> {
pub type: i8,
pub data: &'a [u8],
}
Expand description
A borrowed view of a MessagePack extension value.
Note that the MessagePack header (FixExt vs Ext8/16/32) is determined by the
payload length when encoding. See ExtensionRef::to_format
.
Fields§
§type: i8
Application‑defined extension type code.
data: &'a [u8]
Borrowed payload bytes.
Implementations§
Trait Implementations§
Source§impl<'a> Clone for ExtensionRef<'a>
impl<'a> Clone for ExtensionRef<'a>
Source§fn clone(&self) -> ExtensionRef<'a>
fn clone(&self) -> ExtensionRef<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for ExtensionRef<'a>
impl<'a> Debug for ExtensionRef<'a>
Source§impl<'de> DecodeBorrowed<'de> for ExtensionRef<'de>
impl<'de> DecodeBorrowed<'de> for ExtensionRef<'de>
Source§type Value = ExtensionRef<'de>
type Value = ExtensionRef<'de>
The decoded value.
Source§fn decode_borrowed_with_format<R>(
format: Format,
reader: &mut R,
) -> Result<Self::Value, DecodeError<R::Error>>where
R: IoRead<'de>,
fn decode_borrowed_with_format<R>(
format: Format,
reader: &mut R,
) -> Result<Self::Value, DecodeError<R::Error>>where
R: IoRead<'de>,
Decode with a previously read
Format
.Source§fn decode_borrowed<R>(
reader: &mut R,
) -> Result<<Self as DecodeBorrowed<'de>>::Value, Error<R::Error>>where
R: IoRead<'de>,
fn decode_borrowed<R>(
reader: &mut R,
) -> Result<<Self as DecodeBorrowed<'de>>::Value, Error<R::Error>>where
R: IoRead<'de>,
Decode the next value.
Source§impl<'a, W: IoWrite> Encode<W> for ExtensionRef<'a>
impl<'a, W: IoWrite> Encode<W> for ExtensionRef<'a>
Source§impl<'a> From<ExtensionRef<'a>> for ExtensionOwned
Available on crate feature alloc
only.
impl<'a> From<ExtensionRef<'a>> for ExtensionOwned
Available on crate feature
alloc
only.Source§fn from(value: ExtensionRef<'a>) -> Self
fn from(value: ExtensionRef<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> Ord for ExtensionRef<'a>
impl<'a> Ord for ExtensionRef<'a>
Source§fn cmp(&self, other: &ExtensionRef<'a>) -> Ordering
fn cmp(&self, other: &ExtensionRef<'a>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a> PartialEq for ExtensionRef<'a>
impl<'a> PartialEq for ExtensionRef<'a>
Source§impl<'a> PartialOrd for ExtensionRef<'a>
impl<'a> PartialOrd for ExtensionRef<'a>
Source§impl<const N: usize> TryFrom<ExtensionRef<'_>> for FixedExtension<N>
impl<const N: usize> TryFrom<ExtensionRef<'_>> for FixedExtension<N>
Source§type Error = ExtensionCapacityError
type Error = ExtensionCapacityError
The type returned in the event of a conversion error.
Source§impl TryFrom<ExtensionRef<'_>> for Timestamp32
impl TryFrom<ExtensionRef<'_>> for Timestamp32
Source§type Error = TryFromTimestampError
type Error = TryFromTimestampError
The type returned in the event of a conversion error.
Source§impl TryFrom<ExtensionRef<'_>> for Timestamp64
impl TryFrom<ExtensionRef<'_>> for Timestamp64
Source§type Error = TryFromTimestampError
type Error = TryFromTimestampError
The type returned in the event of a conversion error.
Source§impl TryFrom<ExtensionRef<'_>> for Timestamp96
impl TryFrom<ExtensionRef<'_>> for Timestamp96
Source§type Error = TryFromTimestampError
type Error = TryFromTimestampError
The type returned in the event of a conversion error.
impl<'a> Copy for ExtensionRef<'a>
impl<'a> Eq for ExtensionRef<'a>
impl<'a> StructuralPartialEq for ExtensionRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for ExtensionRef<'a>
impl<'a> RefUnwindSafe for ExtensionRef<'a>
impl<'a> Send for ExtensionRef<'a>
impl<'a> Sync for ExtensionRef<'a>
impl<'a> Unpin for ExtensionRef<'a>
impl<'a> UnwindSafe for ExtensionRef<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'de, T> Decode<'de> for Twhere
T: DecodeBorrowed<'de> + 'de,
impl<'de, T> Decode<'de> for Twhere
T: DecodeBorrowed<'de> + 'de,
Source§type Value<'a> = <T as DecodeBorrowed<'de>>::Value
where
'de: 'a,
T: 'a
type Value<'a> = <T as DecodeBorrowed<'de>>::Value where 'de: 'a, T: 'a
The decoded value (may borrow for
'a
).