Struct amq_protocol::frame::WriteContext
source · [−]pub struct WriteContext<W> {
pub write: W,
pub position: u64,
}
Expand description
Context around a Write
impl that is passed through serializing functions
Currently this only keeps track of the current write position since the start of serialization.
Fields
write: W
position: u64
Implementations
sourceimpl<W> WriteContext<W> where
W: Write,
impl<W> WriteContext<W> where
W: Write,
sourcepub fn into_inner(self) -> (W, u64)
pub fn into_inner(self) -> (W, u64)
Returns the contained Write
and the current position
Trait Implementations
sourceimpl<W> From<W> for WriteContext<W> where
W: Write,
impl<W> From<W> for WriteContext<W> where
W: Write,
sourcefn from(write: W) -> WriteContext<W>ⓘNotable traits for WriteContext<W>impl<W> Write for WriteContext<W> where
W: Write,
fn from(write: W) -> WriteContext<W>ⓘNotable traits for WriteContext<W>impl<W> Write for WriteContext<W> where
W: Write,
W: Write,
Performs the conversion.
sourceimpl<W> Seek for WriteContext<W> where
W: Seek,
impl<W> Seek for WriteContext<W> where
W: Seek,
sourcefn seek(&mut self, pos: SeekFrom) -> Result<u64, Error>
fn seek(&mut self, pos: SeekFrom) -> Result<u64, Error>
Seek to an offset, in bytes, in a stream. Read more
1.55.0 · sourcefn rewind(&mut self) -> Result<(), Error>
fn rewind(&mut self) -> Result<(), Error>
Rewind to the beginning of a stream. Read more
sourceimpl<W> Write for WriteContext<W> where
W: Write,
impl<W> Write for WriteContext<W> where
W: Write,
sourcefn write(&mut self, data: &[u8]) -> Result<usize, Error>
fn write(&mut self, data: &[u8]) -> Result<usize, Error>
Write a buffer into this writer, returning how many bytes were written. Read more
sourcefn flush(&mut self) -> Result<(), Error>
fn flush(&mut self) -> Result<(), Error>
Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
sourcefn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
can_vector
)Determines if this Write
r has an efficient write_vectored
implementation. Read more
1.0.0 · sourcefn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Attempts to write an entire buffer into this writer. Read more
sourcefn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
Auto Trait Implementations
impl<W> RefUnwindSafe for WriteContext<W> where
W: RefUnwindSafe,
impl<W> Send for WriteContext<W> where
W: Send,
impl<W> Sync for WriteContext<W> where
W: Sync,
impl<W> Unpin for WriteContext<W> where
W: Unpin,
impl<W> UnwindSafe for WriteContext<W> where
W: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more