pub struct OctetsPtr(/* private fields */);Expand description
A (safe) raw pointer to an pinned Octets.
Methods from Deref<Target = Octets<'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 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 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 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 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 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 get_bytes(
&mut self,
len: usize,
) -> Result<Octets<'a>, BufferTooShortError>
pub fn get_bytes( &mut self, len: usize, ) -> Result<Octets<'a>, 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<'a>, BufferTooShortError>
pub fn get_bytes_with_u8_length( &mut self, ) -> Result<Octets<'a>, 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<'a>, BufferTooShortError>
pub fn get_bytes_with_u16_length( &mut self, ) -> Result<Octets<'a>, 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<'a>, BufferTooShortError>
pub fn get_bytes_with_varint_length( &mut self, ) -> Result<Octets<'a>, 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(&self, len: usize) -> Result<Octets<'a>, BufferTooShortError>
pub fn peek_bytes(&self, len: usize) -> Result<Octets<'a>, BufferTooShortError>
Reads len bytes from the current offset without copying and without
advancing the buffer.
Sourcepub fn slice(&'a self, len: usize) -> Result<&'a [u8], BufferTooShortError>
pub fn slice(&'a self, len: usize) -> Result<&'a [u8], BufferTooShortError>
Returns a slice of len elements from the current offset.
Sourcepub fn slice_last(&'a self, len: usize) -> Result<&'a [u8], BufferTooShortError>
pub fn slice_last(&'a self, len: usize) -> Result<&'a [u8], BufferTooShortError>
Returns a slice of len elements from the end of the buffer.
Trait Implementations§
Source§impl From<OctetsPtr> for BytesContent
impl From<OctetsPtr> for BytesContent
Source§impl<CTP: ConnectionToPlugin> FromWithPH<OctetsPtr, CTP> for PluginVal
impl<CTP: ConnectionToPlugin> FromWithPH<OctetsPtr, CTP> for PluginVal
fn from_with_ph(value: OctetsPtr, ph: &mut PluginHandler<CTP>) -> Self
Auto Trait Implementations§
impl Freeze for OctetsPtr
impl RefUnwindSafe for OctetsPtr
impl Send for OctetsPtr
impl Sync for OctetsPtr
impl Unpin for OctetsPtr
impl UnwindSafe for OctetsPtr
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.