Enum crypto_screener::modules::message::Msg

source ·
pub enum Msg {
    FetchData,
    SetData(Result<Vec<CryptoData>, Error>),
    SortBy(String),
    ToggleCellSelection(String, String),
    ToggleAbout,
}
Expand description

Enum representing messages that can modify the application’s state.

Each variant of Msg corresponds to a specific action, with associated data if needed to carry out the operation.

Variants§

§

FetchData

Initiates a request to fetch cryptocurrency data.

§

SetData(Result<Vec<CryptoData>, Error>)

Sets the fetched data to the model or stores an error message if the request fails.

  • Ok(Vec<CryptoData>): Successfully retrieved data.
  • Err(reqwest::Error): An error occurred during the data fetch.
§

SortBy(String)

Sorts the data by the specified column.

  • String: The name of the column to sort by (e.g., “price_usd”).
§

ToggleCellSelection(String, String)

Toggles selection state for a specific cell in the data table.

  • String: A unique identifier for the row (e.g., a cryptocurrency ID).
  • String: The name of the column (e.g., “symbol”).
§

ToggleAbout

Toggles the visibility of the “About” modal.

Auto Trait Implementations§

§

impl Freeze for Msg

§

impl !RefUnwindSafe for Msg

§

impl Send for Msg

§

impl Sync for Msg

§

impl Unpin for Msg

§

impl !UnwindSafe for Msg

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.

§

impl<T> Instrument for T

§

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

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

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.

§

impl<T> IntoPropValue<Option<T>> for T

§

fn into_prop_value(self) -> Option<T>

Convert self to a value of a Properties struct.
§

impl<T> IntoPropValue<T> for T

§

fn into_prop_value(self) -> T

Convert self to a value of a Properties struct.
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.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<Token, Builder, How> AllPropsFor<Builder, How> for Token
where Builder: Buildable<Token>, <Builder as Buildable<Token>>::WrappedToken: HasAllProps<<Builder as Buildable<Token>>::Output, How>,

§

impl<T> HasAllProps<(), T> for T