pub struct FileTreeStoreDelta { /* private fields */ }Expand description
One monotone store revision and its precise changes.
Empty deltas retain the current revision; a non-empty successful commit increments it once regardless of the number of changes.
§Examples
use ailloli_ui_fs::{FileKind, FileMetadata, FileTreeStore, FileUri};
let mut store = FileTreeStore::new(FileUri::parse("file:///")?, FileMetadata::new(FileKind::Directory))?;
let delta = store.set_expanded(store.root(), false)?;
assert!(delta.is_empty());
assert_eq!(delta.revision(), 0);Implementations§
Source§impl FileTreeStoreDelta
impl FileTreeStoreDelta
Sourcepub const fn revision(&self) -> u64
pub const fn revision(&self) -> u64
Returns the store revision after this delta.
§Examples
use ailloli_ui_fs::{FileKind, FileMetadata, FileTreeStore, FileUri};
let mut store = FileTreeStore::new(FileUri::parse("file:///")?, FileMetadata::new(FileKind::Directory))?;
assert_eq!(store.set_expanded(store.root(), true)?.revision(), 1);Sourcepub fn changes(&self) -> &[FileTreeDelta]
pub fn changes(&self) -> &[FileTreeDelta]
Borrows ordered incremental changes.
§Examples
use ailloli_ui_fs::{FileKind, FileMetadata, FileTreeStore, FileUri};
let mut store = FileTreeStore::new(FileUri::parse("file:///")?, FileMetadata::new(FileKind::Directory))?;
assert_eq!(store.set_expanded(store.root(), true)?.changes().len(), 1);Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns whether the mutation produced no observable tree change.
§Examples
use ailloli_ui_fs::{FileKind, FileMetadata, FileTreeStore, FileUri};
let mut store = FileTreeStore::new(FileUri::parse("file:///")?, FileMetadata::new(FileKind::Directory))?;
assert!(store.set_expanded(store.root(), false)?.is_empty());Trait Implementations§
Source§impl Clone for FileTreeStoreDelta
impl Clone for FileTreeStoreDelta
Source§fn clone(&self) -> FileTreeStoreDelta
fn clone(&self) -> FileTreeStoreDelta
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FileTreeStoreDelta
impl RefUnwindSafe for FileTreeStoreDelta
impl Send for FileTreeStoreDelta
impl Sync for FileTreeStoreDelta
impl Unpin for FileTreeStoreDelta
impl UnwindSafe for FileTreeStoreDelta
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