i_slint_core::model

Struct ModelNotify

Source
pub struct ModelNotify { /* private fields */ }
Expand description

Dispatch notifications from a Model to one or several ModelPeer. Typically, you would want to put this in the implementation of the Model

Implementations§

Source§

impl ModelNotify

Source

pub fn row_changed(&self, row: usize)

Notify the peers that a specific row was changed

Source

pub fn row_added(&self, index: usize, count: usize)

Notify the peers that rows were added

Source

pub fn row_removed(&self, index: usize, count: usize)

Notify the peers that rows were removed

Source

pub fn reset(&self)

Notify the peer that the model has been changed in some way and everything needs to be reloaded

Trait Implementations§

Source§

impl Default for ModelNotify

Source§

fn default() -> ModelNotify

Returns the “default value” for a type. Read more
Source§

impl ModelTracker for ModelNotify

Source§

fn attach_peer(&self, peer: ModelPeer<'_>)

Attach one peer. The peer will be notified when the model changes

Source§

fn track_row_count_changes(&self)

Register the model as a dependency to the current binding being evaluated, so that it will be notified when the model changes its size.
Source§

fn track_row_data_changes(&self, row: usize)

Register a row as a dependency to the current binding being evaluated, so that it will be notified when the value of that row changes.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.