State

Struct State 

Source
pub struct State<'s> {
    pub cmd: &'s NixCommand,
    pub multi_progress: Rc<MultiProgress>,
    pub handlers: Vec<Box<dyn Handler + 's>>,
    pub term_size: u16,
    pub handlers_len: usize,
    /* private fields */
}

Fields§

§cmd: &'s NixCommand§multi_progress: Rc<MultiProgress>§handlers: Vec<Box<dyn Handler + 's>>§term_size: u16§handlers_len: usize

Keep track of the handler could while applying them. Usefull for debugging.

Implementations§

Source§

impl<'s> State<'s>

Source

pub fn new(cmd: &'s NixCommand) -> Self

Source§

impl<'s> State<'s>

Source

pub fn handle(&mut self, action: &Action<'_>) -> Result<()>

Source

pub fn plug<H: Handler + 's>(&mut self, handler: H)

Source

pub fn add(&mut self, pb: ProgressBar) -> ProgressBar

Source

pub fn remove_separator(&mut self)

Source

pub fn println(&self, msg: impl AsRef<str>) -> Result<()>

Auto Trait Implementations§

§

impl<'s> Freeze for State<'s>

§

impl<'s> !RefUnwindSafe for State<'s>

§

impl<'s> !Send for State<'s>

§

impl<'s> !Sync for State<'s>

§

impl<'s> Unpin for State<'s>

§

impl<'s> !UnwindSafe for State<'s>

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.