pub struct OutputStream<'a>(/* private fields */);Expand description
A CLAP data stream that can be written to.
This helper struct is designed to work with the standard Write trait.
Implementations§
Source§impl<'a> OutputStream<'a>
impl<'a> OutputStream<'a>
Sourcepub fn from_writer<W>(writer: &'a mut W) -> OutputStream<'a> ⓘwhere
W: Write + 'a,
pub fn from_writer<W>(writer: &'a mut W) -> OutputStream<'a> ⓘwhere
W: Write + 'a,
Creates a new output stream for an existing write implementation.
Sourcepub unsafe fn from_raw_mut(raw: &mut clap_ostream) -> &mut OutputStream<'a> ⓘ
pub unsafe fn from_raw_mut(raw: &mut clap_ostream) -> &mut OutputStream<'a> ⓘ
Crates a new output stream for a C FFI-compatible pointer.
§Safety
The caller must ensure the given clap_ostream instance is valid.
Sourcepub fn as_raw_mut(&mut self) -> &mut clap_ostream
pub fn as_raw_mut(&mut self) -> &mut clap_ostream
Returns this output stream as a C FFI-compatible pointer.
Trait Implementations§
Source§impl Write for OutputStream<'_>
impl Write for OutputStream<'_>
Source§fn write(&mut self, buf: &[u8]) -> Result<usize, Error>
fn write(&mut self, buf: &[u8]) -> Result<usize, Error>
Writes a buffer into this writer, returning how many bytes were written. Read more
Source§fn flush(&mut self) -> Result<(), Error>
fn flush(&mut self) -> Result<(), Error>
Flushes this output stream, ensuring that all intermediately buffered
contents reach their destination. Read more
Source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector)1.0.0 · Source§fn 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
Source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
🔬This is a nightly-only experimental API. (
write_all_vectored)Attempts to write multiple buffers into this writer. Read more
Auto Trait Implementations§
impl<'a> !Send for OutputStream<'a>
impl<'a> !Sync for OutputStream<'a>
impl<'a> !UnwindSafe for OutputStream<'a>
impl<'a> Freeze for OutputStream<'a>
impl<'a> RefUnwindSafe for OutputStream<'a>
impl<'a> Unpin for OutputStream<'a>
impl<'a> UnsafeUnpin for OutputStream<'a>
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