pub struct Ctx {
pub container: Option<Container>,
pub dispatched: Vec<BrowserDispatch>,
pub emitted: Vec<ComponentEmit>,
pub redirect: Option<String>,
pub errors: HashMap<String, Vec<String>>,
pub island: Option<String>,
}Expand description
Per-call context carried through action dispatch.
Fields§
§container: Option<Container>§dispatched: Vec<BrowserDispatch>§emitted: Vec<ComponentEmit>§redirect: Option<String>§errors: HashMap<String, Vec<String>>§island: Option<String>Implementations§
Source§impl Ctx
impl Ctx
pub fn new(container: Option<Container>) -> Self
pub fn dispatch_browser(&mut self, event: impl Into<String>, payload: Value)
pub fn emit(&mut self, event: impl Into<String>, payload: Value)
pub fn redirect(&mut self, to: impl Into<String>)
pub fn add_error( &mut self, field: impl Into<String>, message: impl Into<String>, )
pub fn request_island(&mut self, name: impl Into<String>)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Ctx
impl !RefUnwindSafe for Ctx
impl Send for Ctx
impl Sync for Ctx
impl Unpin for Ctx
impl UnsafeUnpin for Ctx
impl !UnwindSafe for Ctx
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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