pub struct Transitions(/* private fields */);Expand description
A collection of ITransition objects.
The handle is shared: clones refer to the same collection, and handles compare by identity. Clearing the collection notifies a removal of every item, and transitions of direct properties are rejected.
Implementations§
Source§impl Transitions
impl Transitions
Sourcepub fn from_items(items: impl IntoIterator<Item = Rc<dyn ITransition>>) -> Self
pub fn from_items(items: impl IntoIterator<Item = Rc<dyn ITransition>>) -> Self
Creates a collection holding items.
Methods from Deref<Target = FerroList<Rc<dyn ITransition>>>§
Sourcepub fn add_collection_changed(
&self,
handler: Rc<CollectionChangedHandler<T>>,
) -> u64
pub fn add_collection_changed( &self, handler: Rc<CollectionChangedHandler<T>>, ) -> u64
Subscribes to changes. Returns a token for
remove_collection_changed.
Sourcepub fn remove_collection_changed(&self, token: u64) -> bool
pub fn remove_collection_changed(&self, token: u64) -> bool
Unsubscribes a handler.
Sourcepub fn has_collection_changed_subscribers(&self) -> bool
pub fn has_collection_changed_subscribers(&self) -> bool
Whether anything is subscribed to changes, typed or untyped.
pub fn is_empty(&self) -> bool
Sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
The number of items the list can hold before its storage grows.
Sourcepub fn set_capacity(&self, capacity: usize)
pub fn set_capacity(&self, capacity: usize)
Sets the number of items the list can hold before its storage grows.
§Panics
Panics if capacity is less than the number of items, as the
managed original throws.
Sourcepub fn reset_behavior(&self) -> ResetBehavior
pub fn reset_behavior(&self) -> ResetBehavior
The reset behavior of the list.
pub fn set_reset_behavior(&self, value: ResetBehavior)
Sourcepub fn validate(&self) -> Option<Rc<dyn Fn(&T)>>where
T: 'static,
pub fn validate(&self) -> Option<Rc<dyn Fn(&T)>>where
T: 'static,
The validation routine that is invoked for every item before it is added to the list.
Sourcepub fn set_validate(&self, value: Option<Rc<dyn Fn(&T)>>)where
T: 'static,
pub fn set_validate(&self, value: Option<Rc<dyn Fn(&T)>>)where
T: 'static,
Sets a validation routine that is invoked for every item before it is added to the list; it rejects an item by panicking.
Sourcepub fn validator(&self) -> Option<Rc<dyn IFerroListItemValidator<T>>>where
T: 'static,
pub fn validator(&self) -> Option<Rc<dyn IFerroListItemValidator<T>>>where
T: 'static,
The validator that is invoked for every item before it is added to the list.
pub fn set_validator(&self, value: Option<Rc<dyn IFerroListItemValidator<T>>>)
Sourcepub fn snapshot(&self) -> Rc<Vec<T>>
pub fn snapshot(&self) -> Rc<Vec<T>>
A snapshot of the items. It stays valid and unchanged if the list is modified.
Sourcepub fn add_range(&self, items: impl IntoIterator<Item = T>)
pub fn add_range(&self, items: impl IntoIterator<Item = T>)
Adds multiple items to the collection.
Sourcepub fn insert_range(&self, index: usize, items: impl IntoIterator<Item = T>)
pub fn insert_range(&self, index: usize, items: impl IntoIterator<Item = T>)
Inserts multiple items at the specified index.
Sourcepub fn move_range(&self, old_index: usize, count: usize, new_index: usize)
pub fn move_range(&self, old_index: usize, count: usize, new_index: usize)
Moves multiple items to a new index.
Sourcepub fn remove_range(&self, index: usize, count: usize)
pub fn remove_range(&self, index: usize, count: usize)
Removes a range of elements from the collection.
Sourcepub fn copy_to(&self, array: &mut [T], array_index: usize)
pub fn copy_to(&self, array: &mut [T], array_index: usize)
Copies the items into array, starting at array_index.
§Panics
Panics if array is too small, as the managed original throws.
Sourcepub fn get_range(&self, index: usize, count: usize) -> Vec<T>
pub fn get_range(&self, index: usize, count: usize) -> Vec<T>
Gets a range of items from the collection.
Sourcepub fn ensure_capacity(&self, capacity: usize)
pub fn ensure_capacity(&self, capacity: usize)
Ensures that the capacity of the list is at least capacity.
Sourcepub fn remove(&self, item: &T) -> bool
pub fn remove(&self, item: &T) -> bool
Removes an item from the collection. Returns true if it was present.
Sourcepub fn remove_all(&self, items: impl IntoIterator<Item = T>)
pub fn remove_all(&self, items: impl IntoIterator<Item = T>)
Removes multiple items from the collection.
Each run of adjacent items that are removed is notified as one removal, from the end of the list to its start.
Trait Implementations§
Source§impl Clone for Transitions
impl Clone for Transitions
Source§impl Debug for Transitions
impl Debug for Transitions
Source§impl Default for Transitions
impl Default for Transitions
Source§impl Deref for Transitions
impl Deref for Transitions
Source§impl MarkupTyped for Transitions
impl MarkupTyped for Transitions
Source§const MARKUP: &'static MarkupType
const MARKUP: &'static MarkupType
Auto Trait Implementations§
impl !RefUnwindSafe for Transitions
impl !Send for Transitions
impl !Sync for Transitions
impl !UnwindSafe for Transitions
impl Freeze for Transitions
impl Unpin for Transitions
impl UnsafeUnpin for Transitions
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more