pub struct Instance<P: Program> { /* private fields */ }Expand description
A particular instance of a running Program.
Implementations§
Source§impl<P: Program> Instance<P>
impl<P: Program> Instance<P>
Sourcepub fn update(&mut self, message: P::Message) -> Task<P::Message>
pub fn update(&mut self, message: P::Message) -> Task<P::Message>
Processes the given message and updates the Instance.
Sourcepub fn view(&self, window: Id) -> Element<'_, P::Message, P::Theme, P::Renderer>
pub fn view(&self, window: Id) -> Element<'_, P::Message, P::Theme, P::Renderer>
Produces the current widget tree of the Instance.
Sourcepub fn subscription(&self) -> Subscription<P::Message>
pub fn subscription(&self) -> Subscription<P::Message>
Returns the current Subscription of the Instance.
Sourcepub fn style(&self, theme: &P::Theme) -> Style
pub fn style(&self, theme: &P::Theme) -> Style
Returns the current theme::Style of the Instance.
Sourcepub fn scale_factor(&self, window: Id) -> f32
pub fn scale_factor(&self, window: Id) -> f32
Returns the current scale factor of the Instance.
Auto Trait Implementations§
impl<P> Freeze for Instance<P>
impl<P> RefUnwindSafe for Instance<P>
impl<P> Send for Instance<P>
impl<P> Sync for Instance<P>
impl<P> Unpin for Instance<P>
impl<P> UnwindSafe for Instance<P>
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> 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