Enum OrderDiagnostic
pub enum OrderDiagnostic {
InvalidName {
name: String,
},
Duplicate {
name: String,
},
Capacity {
name: String,
},
UnknownSystems {
first: String,
second: String,
missing: Vec<String>,
},
Cycle {
path: Vec<String>,
},
}Expand description
An owned, named ordering failure with an actionable fmt::Display message.
Obtained from the checked methods on SystemOrder; Self::kind maps back
to the original error codes.
Variants§
InvalidName
Names must contain 1 through 128 UTF-8 bytes.
Duplicate
The exact, case-sensitive name is already registered.
Capacity
Registering this name would exceed the limit of 256 systems.
UnknownSystems
The requested first -> second dependency has unregistered endpoints.
Fields
Cycle
A closed directed cycle: every adjacent pair is a declared dependency, and the first name is repeated at the end. Only actual cycle members are included, not systems merely blocked by the cycle.
Implementations§
§impl OrderDiagnostic
impl OrderDiagnostic
pub fn kind(&self) -> OrderError
pub fn kind(&self) -> OrderError
Return the corresponding legacy error code without losing this diagnostic.
use ferravex_engine::system_order::{OrderError, SystemOrder};
let error = SystemOrder::default().before_checked("input", "render").unwrap_err();
assert_eq!(error.kind(), OrderError::UnknownSystem);Trait Implementations§
§impl Clone for OrderDiagnostic
impl Clone for OrderDiagnostic
§fn clone(&self) -> OrderDiagnostic
fn clone(&self) -> OrderDiagnostic
Returns a duplicate 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 more§impl Debug for OrderDiagnostic
impl Debug for OrderDiagnostic
§impl Display for OrderDiagnostic
impl Display for OrderDiagnostic
§impl Error for OrderDiagnostic
impl Error for OrderDiagnostic
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
§impl PartialEq for OrderDiagnostic
impl PartialEq for OrderDiagnostic
impl Eq for OrderDiagnostic
impl StructuralPartialEq for OrderDiagnostic
Auto Trait Implementations§
impl Freeze for OrderDiagnostic
impl RefUnwindSafe for OrderDiagnostic
impl Send for OrderDiagnostic
impl Sync for OrderDiagnostic
impl Unpin for OrderDiagnostic
impl UnwindSafe for OrderDiagnostic
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