#[non_exhaustive]pub enum TreeModelError<T: Debug> {
DuplicateId {
id: T,
},
MissingId {
id: T,
},
ReusedId {
id: T,
},
ParentIsLeaf {
id: T,
},
InvalidIndex {
index: usize,
len: usize,
},
Cycle {
id: T,
new_parent: T,
},
NonEmptyBranchToLeaf {
id: T,
},
NotBranch {
id: T,
},
RevisionExhausted,
StaleRevision {
expected: u64,
actual: u64,
},
}Expand description
Validation failure for a retained tree mutation. The whole batch is rolled back on error.
§Examples
use ailloli_ui_widgets::controls::TreeModelError;
let error = TreeModelError::DuplicateId { id: 7_u64 };
assert!(error.to_string().contains("already exists"));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DuplicateId
An inserted ID is already active.
Fields
id: TActive identifier that the insertion attempted to duplicate.
MissingId
A referenced item or parent does not exist.
Fields
id: TIdentifier that could not be resolved in the active model.
ReusedId
An inserted ID was previously removed and permanently retired.
Fields
id: TTombstoned identifier that must not be inserted again.
ParentIsLeaf
An insertion/move target cannot own children.
Fields
id: TLeaf identifier supplied as the requested parent.
InvalidIndex
An insertion/move position exceeds its allowed inclusive upper bound.
Fields
Cycle
A move would make an item its own ancestor.
Fields
id: TIdentifier of the item being moved.
new_parent: TDescendant identifier proposed as the new parent.
NonEmptyBranchToLeaf
An update attempted to turn a populated branch into a leaf.
Fields
id: TPopulated branch identifier whose kind change was rejected.
NotBranch
Expansion was requested for a leaf.
Fields
id: TLeaf identifier supplied to a branch-only operation.
RevisionExhausted
Incrementing the checked u64 revision would overflow.
StaleRevision
Optimistic mutation expected a different current revision.
Trait Implementations§
Source§impl<T: Clone + Debug> Clone for TreeModelError<T>
impl<T: Clone + Debug> Clone for TreeModelError<T>
Source§fn clone(&self) -> TreeModelError<T>
fn clone(&self) -> TreeModelError<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T> Display for TreeModelError<T>
impl<T> Display for TreeModelError<T>
Source§impl<T: Debug> Error for TreeModelError<T>
impl<T: Debug> Error for TreeModelError<T>
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<TreeModelError<FileTreeNodeId>> for FileTreeModelBridgeError
impl From<TreeModelError<FileTreeNodeId>> for FileTreeModelBridgeError
Source§fn from(source: TreeModelError<FileTreeNodeId>) -> Self
fn from(source: TreeModelError<FileTreeNodeId>) -> Self
impl<T: Eq + Debug> Eq for TreeModelError<T>
impl<T: Debug> StructuralPartialEq for TreeModelError<T>
Auto Trait Implementations§
impl<T> Freeze for TreeModelError<T>where
T: Freeze,
impl<T> RefUnwindSafe for TreeModelError<T>where
T: RefUnwindSafe,
impl<T> Send for TreeModelError<T>where
T: Send,
impl<T> Sync for TreeModelError<T>where
T: Sync,
impl<T> Unpin for TreeModelError<T>where
T: Unpin,
impl<T> UnwindSafe for TreeModelError<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.