[][src]Struct yew::html::Scope

pub struct Scope<COMP: Component> { /* fields omitted */ }

A context which allows sending messages to a component.

Methods

impl<COMP: Component> Scope<COMP>[src]

pub fn new() -> Self[src]

visible for testing

pub fn send_message<T>(&self, msg: T) where
    T: Into<COMP::Message>, 
[src]

Send a message to the component

pub fn send_message_batch(&self, messages: Vec<COMP::Message>)[src]

Send a batch of messages to the component

pub fn callback<F, IN, M>(&self, function: F) -> Callback<IN> where
    M: Into<COMP::Message>,
    F: Fn(IN) -> M + 'static, 
[src]

Creates a Callback which will send a message to the linked component's update method when invoked.

pub fn callback_once<F, IN, M>(&self, function: F) -> Callback<IN> where
    M: Into<COMP::Message>,
    F: FnOnce(IN) -> M + 'static, 
[src]

Creates a Callback from a FnOnce which will send a message to the linked component's update method when invoked.

pub fn batch_callback<F, IN>(&self, function: F) -> Callback<IN> where
    F: Fn(IN) -> Vec<COMP::Message> + 'static, 
[src]

Creates a Callback which will send a batch of messages back to the linked component's update method when invoked.

Trait Implementations

impl<COMP: Component> Clone for Scope<COMP>[src]

impl<COMP: Component> Debug for Scope<COMP>[src]

impl<COMP: Component> Default for Scope<COMP>[src]

Auto Trait Implementations

impl<COMP> !RefUnwindSafe for Scope<COMP>

impl<COMP> !Send for Scope<COMP>

impl<COMP> !Sync for Scope<COMP>

impl<COMP> Unpin for Scope<COMP>

impl<COMP> !UnwindSafe for Scope<COMP>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CloneAny for T where
    T: Clone + Any
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.