Skip to main content

Item

Trait Item 

Source
pub trait Item:
    Send
    + Sync
    + Debug {
    // Required methods
    fn filter_value(&self) -> String;
    fn box_clone(&self) -> Box<dyn Item + Send + Sync>;
    fn as_any(&self) -> &dyn Any;

    // Provided method
    fn as_default_item(&self) -> Option<&dyn DefaultItem> { ... }
}
Expand description

Item is an item that appears in the list.

Note: box_clone and as_any are Rust-side requirements (trait objects cannot structurally clone or downcast), mirroring the upstream Go interface which is implemented by any struct.

Required Methods§

Source

fn filter_value(&self) -> String

FilterValue is the value we use when filtering against this item when we’re filtering the list.

Source

fn box_clone(&self) -> Box<dyn Item + Send + Sync>

Clones this item into a boxed trait object (Rust-side adaptation).

Source

fn as_any(&self) -> &dyn Any

Downcasts to Any (Rust-side adaptation for delegate type checks).

Provided Methods§

Source

fn as_default_item(&self) -> Option<&dyn DefaultItem>

Returns the item as a DefaultItem view, if it implements it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§