Skip to main content

RenderIndicatorCpt

Struct RenderIndicatorCpt 

Source
pub struct RenderIndicatorCpt<CA, CM>
where CA: EzArgs, CM: EzMsg,
{ /* private fields */ }
Expand description

A component to display a colored indicator alternating colors based on the frame rate of the terminal.

Implementations§

Source§

impl<CA, CM> RenderIndicatorCpt<CA, CM>
where CA: EzArgs, CM: EzMsg,

Source

pub fn with_palette(palette: &EzPalette) -> Self

Create a new RenderIndicatorCpt component with two styles derived from one [Palette].

Source

pub fn with_palettes(palette_a: &EzPalette, palette_b: &EzPalette) -> Self

Create a new RenderIndicatorCpt component with two styles derived from two [Palette]s.

Trait Implementations§

Source§

impl<CID, CA, CS, CM> Component<CID, CA, CS, CM> for RenderIndicatorCpt<CA, CM>
where CID: EzCptIds, CA: EzArgs, CS: EzState, CM: EzMsg,

Source§

fn on_event( &mut self, ev: EzEvent<CID, CM>, _: &mut State<CS>, ) -> Vec<EzEvent<CID, CM>>

Method to implement to handle events. The component will receive any event if it is focused; but only events it is subscribed to otherwise.
Source§

fn init(&mut self, state: &mut State<CS>) -> Vec<EzEvent<CID, CM>>

Method called on first tick only.
Source§

fn tick(&mut self, state: &mut State<CS>) -> Vec<EzEvent<CID, CM>>

Method called on every tick. You should implement it only if you need to save a reference to the state or if your business logic needs to execute some code on a regular basis.
Source§

fn focusable(&self) -> bool

Whether the component is focusable or not.
Source§

fn legend(&self) -> Option<Legend>

Get the component’s hotkeys legend.
Source§

fn capture_focus(&mut self, forward: bool) -> bool

Returns true if the focus is handled internally. Let’s say this component has two inner focusable area: Read more
Source§

impl<CA, CM> Debug for RenderIndicatorCpt<CA, CM>
where CA: EzArgs + Debug, CM: EzMsg + Debug,

Source§

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

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

impl<CA, CM> Default for RenderIndicatorCpt<CA, CM>
where CA: EzArgs, CM: EzMsg,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<CA, CM> MockComponent for RenderIndicatorCpt<CA, CM>
where CA: EzArgs, CM: EzMsg,

Source§

fn draw(&mut self, area: Rect, buf: &mut Buffer, theme: &Theme)

Draw the component in the given area of the given buffer.
Source§

impl<CA, CM> MockProps for RenderIndicatorCpt<CA, CM>
where CA: EzArgs, CM: EzMsg,

Source§

fn props(&self) -> Option<&Props>

Get a reference to the component’s attribute
Source§

fn props_mut(&mut self) -> Option<&mut Props>

Get a mutable reference to the component’s attribute

Auto Trait Implementations§

§

impl<CA, CM> Freeze for RenderIndicatorCpt<CA, CM>

§

impl<CA, CM> RefUnwindSafe for RenderIndicatorCpt<CA, CM>

§

impl<CA, CM> Send for RenderIndicatorCpt<CA, CM>
where PhantomData<CA>: Send, PhantomData<CM>: Send,

§

impl<CA, CM> Sync for RenderIndicatorCpt<CA, CM>
where PhantomData<CA>: Sync, PhantomData<CM>: Sync,

§

impl<CA, CM> Unpin for RenderIndicatorCpt<CA, CM>

§

impl<CA, CM> UnsafeUnpin for RenderIndicatorCpt<CA, CM>

§

impl<CA, CM> UnwindSafe for RenderIndicatorCpt<CA, CM>

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more