pub struct ComponentLink<COMP: Component> { /* private fields */ }Expand description
Link to component’s scope for creating callbacks.
Implementations§
Source§impl<COMP> ComponentLink<COMP>where
COMP: Component + Renderable<COMP>,
impl<COMP> ComponentLink<COMP>where
COMP: Component + Renderable<COMP>,
Sourcepub fn send_back<F, IN>(&self, function: F) -> Callback<IN>
pub fn send_back<F, IN>(&self, function: F) -> Callback<IN>
This method sends messages back to the component’s loop.
Sourcepub fn send_self(&mut self, msg: COMP::Message)
pub fn send_self(&mut self, msg: COMP::Message)
This method sends a message to this component immediately.
Sourcepub fn send_future<F: Future<Item = COMP::Message, Error = impl Error + 'static> + 'static>(
&self,
future: F,
)
pub fn send_future<F: Future<Item = COMP::Message, Error = impl Error + 'static> + 'static>( &self, future: F, )
This method processes a Future that returns a message and sends it back to the component’s loop.
Sourcepub fn connect_event<F, IN>(&self, event: &str, function: F)
pub fn connect_event<F, IN>(&self, event: &str, function: F)
This method creates an event listener on the window for the specified event that will fire the closure and send the message to the message loop when fired.
Auto Trait Implementations§
impl<COMP> Freeze for ComponentLink<COMP>
impl<COMP> !RefUnwindSafe for ComponentLink<COMP>
impl<COMP> !Send for ComponentLink<COMP>
impl<COMP> !Sync for ComponentLink<COMP>
impl<COMP> Unpin for ComponentLink<COMP>
impl<COMP> !UnwindSafe for ComponentLink<COMP>
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