Skip to main content

PathFigures

Struct PathFigures 

Source
pub struct PathFigures(/* private fields */);
Expand description

A collection of PathFigures.

Implementations§

Source§

impl PathFigures

Source

pub fn new() -> Self

Creates an empty collection.

Source

pub fn from_items(items: impl IntoIterator<Item = Ref<PathFigure>>) -> Self

Creates a collection holding items.

Source

pub fn parse(path_data: &str) -> Result<PathFigures, FormatError>

Parses the specified path data to path figures.

Methods from Deref<Target = MediaCollection<Ref<PathFigure>>>§

Source

pub fn list(&self) -> &Rc<FerroList<T>>

The underlying list.

Source

pub fn ptr_eq(&self, other: &Self) -> bool

Whether both handles refer to the same list.

Source

pub fn reset_behavior(&self) -> ResetBehavior

The action notified when the list is cleared.

Source

pub fn set_reset_behavior(&self, value: ResetBehavior)

Sets the action notified when the list is cleared.

Source

pub fn len(&self) -> usize

The number of items.

Source

pub fn is_empty(&self) -> bool

Source

pub fn get(&self, index: usize) -> T

The item at index. Panics if the index is out of range.

Source

pub fn to_vec(&self) -> Vec<T>

A copy of the items.

Source

pub fn iter(&self) -> IntoIter<T> ⓘ

Iterates over a snapshot of the items.

Source

pub fn add(&self, item: T)

Appends an item.

Source

pub fn add_range(&self, items: impl IntoIterator<Item = T>)

Appends several items with a single notification.

Source

pub fn insert(&self, index: usize, item: T)

Inserts an item at index.

Source

pub fn remove_at(&self, index: usize)

Removes the item at index.

Source

pub fn clear(&self)

Removes all items.

Source

pub fn collection_changed( &self, handler: impl for<'a, 'b> Fn(&'a NotifyCollectionChangedEventArgs<'b, T>) + 'static, ) -> Rc<dyn IDisposable>

Subscribes to changes of the list. Disposing the returned handle unsubscribes.

Source

pub fn for_each_item( &self, added: impl Fn(usize, &T) + 'static, removed: impl Fn(usize, &T) + 'static, reset: impl Fn() + 'static, ) -> Rc<dyn IDisposable>

Invokes added for every item currently in the list and for every item added later, removed for every item removed and reset when the list is reset.

Source

pub fn set(&self, index: usize, value: T)

Replaces the item at index.

Source

pub fn contains(&self, item: &T) -> bool

Whether the list contains item.

Source

pub fn index_of(&self, item: &T) -> Option<usize>

The index of the first occurrence of item.

Source

pub fn remove(&self, item: &T) -> bool

Removes the first occurrence of item; returns whether it was found.

Trait Implementations§

Source§

impl Clone for PathFigures

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for PathFigures

Source§

fn default() -> Self

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

impl Deref for PathFigures

Source§

type Target = MediaCollection<Ref<PathFigure>>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl FromIterator<Ref<PathFigure>> for PathFigures

Source§

fn from_iter<I: IntoIterator<Item = Ref<PathFigure>>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl MarkupTyped for PathFigures

Source§

const MARKUP: &'static MarkupType

The markup metadata of the type.
Source§

impl PartialEq for PathFigures

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PathFigures

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> AnyValue for T
where T: PartialEq + 'static,

Source§

fn any_value_as_any(&self) -> &(dyn Any + 'static)

Source§

fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool

Source§

fn any_value_type_name(&self) -> &'static str

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> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> PropertyValue for T
where T: Clone + PartialEq + 'static,

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.