Skip to main content

VecWrite

Struct VecWrite 

Source
pub struct VecWrite<'v, T> { /* private fields */ }
Expand description

Writes to something implementing std::io::Write

Implementations§

Source§

impl<'v, T> VecWrite<'v, T>

Source

pub fn new(upstream: &'v mut Vec<T>) -> VecWrite<'v, T>

Creates a new terminal writer.

Trait Implementations§

Source§

impl<'v, W> Debug for VecWrite<'v, W>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, T: Text<'a>> Render<'a, T> for VecWrite<'_, T>

Available on crate feature std only.
Source§

type Error = &'static str

The type of the output
Source§

fn write_all(&mut self, s: &[T]) -> Result<(), &'static str>

Write to the output
Source§

fn fail_doc(&self) -> Self::Error

Emit an error
Source§

impl<'a, T: Text<'a>> RenderAnnotated<'a, T> for VecWrite<'_, T>

Available on crate feature std only.
Source§

fn push_annotation(&mut self, _: Rc<AnsiStyle>) -> Result<(), Self::Error>

Push an annotation onto the stack
Source§

fn pop_annotation(&mut self) -> Result<(), Self::Error>

Pop an annotation from the stack

Auto Trait Implementations§

§

impl<'v, T> Freeze for VecWrite<'v, T>

§

impl<'v, T> RefUnwindSafe for VecWrite<'v, T>
where T: RefUnwindSafe,

§

impl<'v, T> Send for VecWrite<'v, T>
where T: Send,

§

impl<'v, T> Sync for VecWrite<'v, T>
where T: Sync,

§

impl<'v, T> Unpin for VecWrite<'v, T>

§

impl<'v, T> UnsafeUnpin for VecWrite<'v, T>

§

impl<'v, T> !UnwindSafe for VecWrite<'v, T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.