Samples
struct · ferroui-controls-charts · v0.5.0
struct Samples
One dimension's values. The same instance can be shared by multiple series.
ItemsSource preserves arbitrary boxed values. Supported collections use the
existing FerroUI adapters, including live Rc<FerroList<T>>; unsupported
objects produce an empty view. Source changes invalidate a lazily decoded
snapshot. No chart owns a Samples object, and change subscriptions capture
only weak references.
Members
TYPEto_refitems_source_propertyconstructnewfrom_valuesfrom_sourceitems_sourceset_items_sourceset_sourcesourceviewcountis_emptyget_atvalue_atsnapshotrevisionadd_changedremove_changed
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<Samples>
Returns a strong reference to this object.
items_source_property
fn items_source_property() -> &'static StyledProperty<Option<BoxedValue>>
The underlying, optionally observable FerroUI item source.
construct
fn construct() -> Self
new
fn new() -> Ref<Self>
from_values
fn from_values<T: PropertyValue>(values: impl IntoIterator<Item = T>) -> Ref<Self>
from_source
fn from_source(source: ItemsSource) -> Ref<Self>
items_source
fn items_source(self: &Self) -> Option<BoxedValue>
The original source object, including unsupported values. Unsupported scalar objects remain readable here and produce an empty chart view.
set_items_source
fn set_items_source(self: &Self, source: Option<BoxedValue>)
set_source
fn set_source(self: &Self, source: Option<ItemsSource>)
Assign an existing FerroUI collection adapter without boxing it at the call site.
source
fn source(self: &Self) -> Option<ItemsSource>
Resolve the source through FerroUI's normal collection conversions. This
also permits model collection types registered with
ItemsSource::register_binding_conversion to be used in bindings.
view
fn view(self: &Self) -> Rc<ItemsSourceView>
Standard FerroUI view of the current source.
count
fn count(self: &Self) -> usize
is_empty
fn is_empty(self: &Self) -> bool
get_at
fn get_at(self: &Self, index: usize) -> Option<BoxedValue>
Raw source item; None for an out-of-range index or a null item.
value_at
fn value_at(self: &Self, index: usize) -> Option<SampleValue>
Decoded item. Unsupported/null values remain gaps rather than shifting indexes.
snapshot
fn snapshot(self: &Self) -> Rc<[Option<SampleValue>]>
A shared snapshot, decoded once per revision and reused by every consumer.
revision
fn revision(self: &Self) -> u64
add_changed
fn add_changed(self: &Self, handler: Rc<dyn Fn() -> ()>) -> u64
Observe both source replacement and changes within a notifying source.
remove_changed
fn remove_changed(self: &Self, token: u64) -> bool
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyFerroObjectImplExtClassDefaultsErasedDestructorIntoEitherDerefUpcast<T>Upcast<Samples>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleFerroObjectImplDrop
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.