pub struct DetailModel { /* private fields */ }Expand description
Ordered detail state with stable IDs. Upserting an existing record keeps its insertion position and its expansion state, which prevents a streaming terminal/tool update from unexpectedly re-expanding expensive output.
Implementations§
Source§impl DetailModel
impl DetailModel
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn get(&self, id: &str) -> Option<&DetailRecord>
pub fn iter(&self) -> impl Iterator<Item = &DetailRecord>
Sourcepub fn apply(&mut self, event: DetailEvent) -> bool
pub fn apply(&mut self, event: DetailEvent) -> bool
Apply a detail event. false means a SetExpanded target was absent.
pub fn set_expanded(&mut self, id: impl Into<String>, expanded: bool) -> bool
pub fn toggle(&mut self, id: &str) -> bool
Trait Implementations§
Source§impl Clone for DetailModel
impl Clone for DetailModel
Source§fn clone(&self) -> DetailModel
fn clone(&self) -> DetailModel
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DetailModel
impl Debug for DetailModel
Source§impl Default for DetailModel
impl Default for DetailModel
Source§fn default() -> DetailModel
fn default() -> DetailModel
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DetailModel
impl<'de> Deserialize<'de> for DetailModel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for DetailModel
Source§impl PartialEq for DetailModel
impl PartialEq for DetailModel
Source§impl Serialize for DetailModel
impl Serialize for DetailModel
impl StructuralPartialEq for DetailModel
Auto Trait Implementations§
impl Freeze for DetailModel
impl RefUnwindSafe for DetailModel
impl Send for DetailModel
impl Sync for DetailModel
impl Unpin for DetailModel
impl UnsafeUnpin for DetailModel
impl UnwindSafe for DetailModel
Blanket Implementations§
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
Mutably borrows from an owned value. Read more