pub struct OctetsMutPtr(/* private fields */);Expand description
A (safe) raw pointer to an pinned OctetsMut.
Methods from Deref<Target = OctetsMut<'static>>§
Sourcepub fn get_u8(&mut self) -> Result<u8, BufferTooShortError>
pub fn get_u8(&mut self) -> Result<u8, BufferTooShortError>
Reads an unsigned 8-bit integer from the current offset and advances the buffer.
Sourcepub fn peek_u8(&mut self) -> Result<u8, BufferTooShortError>
pub fn peek_u8(&mut self) -> Result<u8, BufferTooShortError>
Reads an unsigned 8-bit integer from the current offset without advancing the buffer.
Sourcepub fn put_u8(&mut self, v: u8) -> Result<&mut [u8], BufferTooShortError>
pub fn put_u8(&mut self, v: u8) -> Result<&mut [u8], BufferTooShortError>
Writes an unsigned 8-bit integer at the current offset and advances the buffer.
Sourcepub fn get_u16(&mut self) -> Result<u16, BufferTooShortError>
pub fn get_u16(&mut self) -> Result<u16, BufferTooShortError>
Reads an unsigned 16-bit integer in network byte-order from the current offset and advances the buffer.
Sourcepub fn put_u16(&mut self, v: u16) -> Result<&mut [u8], BufferTooShortError>
pub fn put_u16(&mut self, v: u16) -> Result<&mut [u8], BufferTooShortError>
Writes an unsigned 16-bit integer in network byte-order at the current offset and advances the buffer.
Sourcepub fn get_u24(&mut self) -> Result<u32, BufferTooShortError>
pub fn get_u24(&mut self) -> Result<u32, BufferTooShortError>
Reads an unsigned 24-bit integer in network byte-order from the current offset and advances the buffer.
Sourcepub fn put_u24(&mut self, v: u32) -> Result<&mut [u8], BufferTooShortError>
pub fn put_u24(&mut self, v: u32) -> Result<&mut [u8], BufferTooShortError>
Writes an unsigned 24-bit integer in network byte-order at the current offset and advances the buffer.
Sourcepub fn get_u32(&mut self) -> Result<u32, BufferTooShortError>
pub fn get_u32(&mut self) -> Result<u32, BufferTooShortError>
Reads an unsigned 32-bit integer in network byte-order from the current offset and advances the buffer.
Sourcepub fn put_u32(&mut self, v: u32) -> Result<&mut [u8], BufferTooShortError>
pub fn put_u32(&mut self, v: u32) -> Result<&mut [u8], BufferTooShortError>
Writes an unsigned 32-bit integer in network byte-order at the current offset and advances the buffer.
Sourcepub fn get_u64(&mut self) -> Result<u64, BufferTooShortError>
pub fn get_u64(&mut self) -> Result<u64, BufferTooShortError>
Reads an unsigned 64-bit integer in network byte-order from the current offset and advances the buffer.
Sourcepub fn put_u64(&mut self, v: u64) -> Result<&mut [u8], BufferTooShortError>
pub fn put_u64(&mut self, v: u64) -> Result<&mut [u8], BufferTooShortError>
Writes an unsigned 64-bit integer in network byte-order at the current offset and advances the buffer.
Sourcepub fn get_varint(&mut self) -> Result<u64, BufferTooShortError>
pub fn get_varint(&mut self) -> Result<u64, BufferTooShortError>
Reads an unsigned variable-length integer in network byte-order from the current offset and advances the buffer.
Sourcepub fn put_varint(&mut self, v: u64) -> Result<&mut [u8], BufferTooShortError>
pub fn put_varint(&mut self, v: u64) -> Result<&mut [u8], BufferTooShortError>
Writes an unsigned variable-length integer in network byte-order at the current offset and advances the buffer.
Sourcepub fn put_varint_with_len(
&mut self,
v: u64,
len: usize,
) -> Result<&mut [u8], BufferTooShortError>
pub fn put_varint_with_len( &mut self, v: u64, len: usize, ) -> Result<&mut [u8], BufferTooShortError>
Writes an unsigned variable-length integer of the specified length, in network byte-order at the current offset and advances the buffer.
Sourcepub fn get_bytes(
&mut self,
len: usize,
) -> Result<Octets<'_>, BufferTooShortError>
pub fn get_bytes( &mut self, len: usize, ) -> Result<Octets<'_>, BufferTooShortError>
Reads len bytes from the current offset without copying and advances
the buffer.
Sourcepub fn get_bytes_mut(
&mut self,
len: usize,
) -> Result<OctetsMut<'_>, BufferTooShortError>
pub fn get_bytes_mut( &mut self, len: usize, ) -> Result<OctetsMut<'_>, BufferTooShortError>
Reads len bytes from the current offset without copying and advances
the buffer.
Sourcepub fn get_bytes_with_u8_length(
&mut self,
) -> Result<Octets<'_>, BufferTooShortError>
pub fn get_bytes_with_u8_length( &mut self, ) -> Result<Octets<'_>, BufferTooShortError>
Reads len bytes from the current offset without copying and advances
the buffer, where len is an unsigned 8-bit integer prefix.
Sourcepub fn get_bytes_with_u16_length(
&mut self,
) -> Result<Octets<'_>, BufferTooShortError>
pub fn get_bytes_with_u16_length( &mut self, ) -> Result<Octets<'_>, BufferTooShortError>
Reads len bytes from the current offset without copying and advances
the buffer, where len is an unsigned 16-bit integer prefix in network
byte-order.
Sourcepub fn get_bytes_with_varint_length(
&mut self,
) -> Result<Octets<'_>, BufferTooShortError>
pub fn get_bytes_with_varint_length( &mut self, ) -> Result<Octets<'_>, BufferTooShortError>
Reads len bytes from the current offset without copying and advances
the buffer, where len is an unsigned variable-length integer prefix
in network byte-order.
Sourcepub fn peek_bytes(
&mut self,
len: usize,
) -> Result<Octets<'_>, BufferTooShortError>
pub fn peek_bytes( &mut self, len: usize, ) -> Result<Octets<'_>, BufferTooShortError>
Reads len bytes from the current offset without copying and without
advancing the buffer.
Sourcepub fn peek_bytes_mut(
&mut self,
len: usize,
) -> Result<OctetsMut<'_>, BufferTooShortError>
pub fn peek_bytes_mut( &mut self, len: usize, ) -> Result<OctetsMut<'_>, BufferTooShortError>
Reads len bytes from the current offset without copying and without
advancing the buffer.
Sourcepub fn put_bytes(&mut self, v: &[u8]) -> Result<(), BufferTooShortError>
pub fn put_bytes(&mut self, v: &[u8]) -> Result<(), BufferTooShortError>
Writes len bytes from the current offset without copying and advances
the buffer.
Sourcepub fn split_at(
&mut self,
off: usize,
) -> Result<(OctetsMut<'_>, OctetsMut<'_>), BufferTooShortError>
pub fn split_at( &mut self, off: usize, ) -> Result<(OctetsMut<'_>, OctetsMut<'_>), BufferTooShortError>
Splits the buffer in two at the given absolute offset.
Sourcepub fn slice(
&'a mut self,
len: usize,
) -> Result<&'a mut [u8], BufferTooShortError>
pub fn slice( &'a mut self, len: usize, ) -> Result<&'a mut [u8], BufferTooShortError>
Returns a slice of len elements from the current offset.
Sourcepub fn slice_last(
&'a mut self,
len: usize,
) -> Result<&'a mut [u8], BufferTooShortError>
pub fn slice_last( &'a mut self, len: usize, ) -> Result<&'a mut [u8], BufferTooShortError>
Returns a slice of len elements from the end of the buffer.
Trait Implementations§
Source§impl Debug for OctetsMutPtr
impl Debug for OctetsMutPtr
Source§impl Deref for OctetsMutPtr
impl Deref for OctetsMutPtr
Source§impl DerefMut for OctetsMutPtr
impl DerefMut for OctetsMutPtr
Source§impl From<&mut OctetsMut<'_>> for OctetsMutPtr
impl From<&mut OctetsMut<'_>> for OctetsMutPtr
Source§fn from(value: &mut OctetsMut<'_>) -> OctetsMutPtr
fn from(value: &mut OctetsMut<'_>) -> OctetsMutPtr
Source§impl From<OctetsMutPtr> for BytesContent
impl From<OctetsMutPtr> for BytesContent
Source§fn from(value: OctetsMutPtr) -> Self
fn from(value: OctetsMutPtr) -> Self
Source§impl<CTP: ConnectionToPlugin> FromWithPH<OctetsMutPtr, CTP> for PluginVal
impl<CTP: ConnectionToPlugin> FromWithPH<OctetsMutPtr, CTP> for PluginVal
fn from_with_ph(value: OctetsMutPtr, ph: &mut PluginHandler<CTP>) -> Self
Auto Trait Implementations§
impl Freeze for OctetsMutPtr
impl RefUnwindSafe for OctetsMutPtr
impl Send for OctetsMutPtr
impl Sync for OctetsMutPtr
impl Unpin for OctetsMutPtr
impl UnwindSafe for OctetsMutPtr
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T, CTP> IntoWithPH<PluginVal, CTP> for T
impl<T, CTP> IntoWithPH<PluginVal, CTP> for T
fn into_with_ph(self, ph: &mut PluginHandler<CTP>) -> PluginVal
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.