pub struct OutOctetStream { /* private fields */ }
Implementations§
Source§impl OutOctetStream
impl OutOctetStream
pub fn new() -> Self
Sourcepub fn octets(&self) -> Vec<u8> ⓘ
pub fn octets(&self) -> Vec<u8> ⓘ
Returns an owned Vec<u8>
containing the octets.
Clones the internal data, which can be expensive for large vectors.
Sourcepub fn octets_ref(&self) -> &[u8] ⓘ
pub fn octets_ref(&self) -> &[u8] ⓘ
Returns a borrowed slice of the internal octets.
This method is more efficient as it avoids cloning.
Trait Implementations§
Source§impl Default for OutOctetStream
impl Default for OutOctetStream
Source§impl WriteOctetStream for OutOctetStream
impl WriteOctetStream for OutOctetStream
fn write(&mut self, v: &[u8]) -> Result<()>
fn write_u64(&mut self, v: u64) -> Result<()>
fn write_i64(&mut self, v: i64) -> Result<()>
fn write_u32(&mut self, v: u32) -> Result<()>
fn write_i32(&mut self, v: i32) -> Result<()>
fn write_u16(&mut self, v: u16) -> Result<()>
fn write_i16(&mut self, v: i16) -> Result<()>
fn write_u8(&mut self, v: u8) -> Result<()>
fn write_i8(&mut self, v: i8) -> Result<()>
Auto Trait Implementations§
impl Freeze for OutOctetStream
impl RefUnwindSafe for OutOctetStream
impl Send for OutOctetStream
impl Sync for OutOctetStream
impl Unpin for OutOctetStream
impl UnwindSafe for OutOctetStream
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