pub struct ExtensionOwned {
pub type: i8,
pub data: Vec<u8>,
}
Available on crate feature
alloc
only.Expand description
An owned container for extension payloads.
Fields§
§type: i8
Application‑defined extension type code.
data: Vec<u8>
payload bytes.
Implementations§
Source§impl ExtensionOwned
impl ExtensionOwned
Sourcepub fn new(type: i8, data: Vec<u8>) -> Self
pub fn new(type: i8, data: Vec<u8>) -> Self
Create an owned extension value with the given type code and payload.
Sourcepub fn as_ref(&self) -> ExtensionRef<'_>
pub fn as_ref(&self) -> ExtensionRef<'_>
Borrow as ExtensionRef
for encoding.
Trait Implementations§
Source§impl Clone for ExtensionOwned
impl Clone for ExtensionOwned
Source§fn clone(&self) -> ExtensionOwned
fn clone(&self) -> ExtensionOwned
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 Debug for ExtensionOwned
impl Debug for ExtensionOwned
Source§impl<'de> DecodeBorrowed<'de> for ExtensionOwned
impl<'de> DecodeBorrowed<'de> for ExtensionOwned
Source§type Value = ExtensionOwned
type Value = ExtensionOwned
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<W: IoWrite> Encode<W> for ExtensionOwned
impl<W: IoWrite> Encode<W> for ExtensionOwned
Source§impl<'a> From<ExtensionRef<'a>> for ExtensionOwned
impl<'a> From<ExtensionRef<'a>> for ExtensionOwned
Source§fn from(value: ExtensionRef<'a>) -> Self
fn from(value: ExtensionRef<'a>) -> Self
Converts to this type from the input type.
Source§impl<const N: usize> From<FixedExtension<N>> for ExtensionOwned
impl<const N: usize> From<FixedExtension<N>> for ExtensionOwned
Source§fn from(value: FixedExtension<N>) -> Self
fn from(value: FixedExtension<N>) -> Self
Converts to this type from the input type.
Source§impl Ord for ExtensionOwned
impl Ord for ExtensionOwned
Source§fn cmp(&self, other: &ExtensionOwned) -> Ordering
fn cmp(&self, other: &ExtensionOwned) -> 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 PartialEq for ExtensionOwned
impl PartialEq for ExtensionOwned
Source§impl PartialOrd for ExtensionOwned
impl PartialOrd for ExtensionOwned
impl Eq for ExtensionOwned
impl StructuralPartialEq for ExtensionOwned
Auto Trait Implementations§
impl Freeze for ExtensionOwned
impl RefUnwindSafe for ExtensionOwned
impl Send for ExtensionOwned
impl Sync for ExtensionOwned
impl Unpin for ExtensionOwned
impl UnwindSafe for ExtensionOwned
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
).