[−][src]Struct yew::html::Scope
A context which allows sending messages to a component.
Implementations
impl<COMP: Component> Scope<COMP>
[src]
pub fn get_parent(&self) -> Option<&AnyScope>
[src]
Returns the parent scope
pub fn get_component(&self) -> Option<impl Deref<Target = COMP> + '_>
[src]
Returns the linked component if available
pub fn send_message<T>(&self, msg: T) where
T: Into<COMP::Message>,
[src]
T: Into<COMP::Message>,
Send a message to the component.
Please be aware that currently this method synchronously schedules a call to the Component interface.
pub fn send_message_batch(&self, messages: Vec<COMP::Message>)
[src]
Send a batch of messages to the component.
This is useful for reducing re-renders of the components because the messages are handled together and the view function is called only once if needed.
Please be aware that currently this method synchronously schedules calls to the Component interface.
pub fn callback<F, IN, M>(&self, function: F) -> Callback<IN> where
M: Into<COMP::Message>,
F: Fn(IN) -> M + 'static,
[src]
M: Into<COMP::Message>,
F: Fn(IN) -> M + 'static,
Creates a Callback
which will send a message to the linked
component's update method when invoked.
Please be aware that currently the result of this callback synchronously schedules a call to the Component interface.
pub fn callback_once<F, IN, M>(&self, function: F) -> Callback<IN> where
M: Into<COMP::Message>,
F: FnOnce(IN) -> M + 'static,
[src]
M: Into<COMP::Message>,
F: FnOnce(IN) -> M + 'static,
Creates a Callback
from a FnOnce which will send a message
to the linked component's update method when invoked.
Please be aware that currently the result of this callback will synchronously schedule calls to the Component interface.
pub fn batch_callback<F, IN>(&self, function: F) -> Callback<IN> where
F: Fn(IN) -> Vec<COMP::Message> + 'static,
[src]
F: Fn(IN) -> Vec<COMP::Message> + 'static,
Creates a Callback
which will send a batch of messages back
to the linked component's update method when invoked.
Please be aware that currently the results of these callbacks will synchronously schedule calls to the Component interface.
Trait Implementations
impl<COMP: Component> Clone for Scope<COMP>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<COMP: Component> Debug for Scope<COMP>
[src]
impl<COMP: Component> From<Scope<COMP>> for AnyScope
[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]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
[src]
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CloneAny for T where
T: Clone + Any,
[src]
T: Clone + Any,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,