SimpleOutput

Struct SimpleOutput 

Source
pub struct SimpleOutput<I: IoOutput> {
    pub io_output: I,
    pub context: DynContext,
}
Expand description

An output that simply composes an owned I/O stream with a dynamic context

Fields§

§io_output: I§context: DynContext

Trait Implementations§

Source§

impl<I> Output for SimpleOutput<I>
where I: IoOutput,

Source§

type Io<'b> = &'b mut I where Self: 'b

The I/O stream type
Source§

type Ctx = DynContext

The context holder
Source§

type Error = <I as IoOutput>::Error

The error type for write operations.
Source§

async fn write(&mut self, value: &str) -> Result<(), Self::Error>

Writes the given value to the output.
Source§

fn split(&mut self) -> (Self::Io<'_>, &Self::Ctx)

Splits into the context and the I/O stream, so that they can be used separately
Source§

fn context(&self) -> &Self::Ctx

Gets all the context associated with this output
Source§

fn get_ctx<T>(&self) -> &T
where Self::Ctx: ContextProvides<T>,

Gets a particular context value

Auto Trait Implementations§

§

impl<I> Freeze for SimpleOutput<I>
where I: Freeze,

§

impl<I> !RefUnwindSafe for SimpleOutput<I>

§

impl<I> !Send for SimpleOutput<I>

§

impl<I> !Sync for SimpleOutput<I>

§

impl<I> Unpin for SimpleOutput<I>
where I: Unpin,

§

impl<I> !UnwindSafe for SimpleOutput<I>

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.