pub enum ObjectError {
NotFound {
handle: ObjectHandle,
},
StaleHandle {
handle: ObjectHandle,
current_generation: u32,
},
TypeMismatch {
handle: ObjectHandle,
expected: ObjectType,
actual: ObjectType,
},
MethodNotFound {
handle: ObjectHandle,
method_name: String,
},
InvalidArgument {
handle: ObjectHandle,
method_name: String,
argument: String,
reason: String,
},
}Expand description
Errors that can occur when working with the object model
Variants§
NotFound
The requested object was not found in the registry
Fields
§
handle: ObjectHandleStaleHandle
The handle refers to an object that has been deleted and recreated
TypeMismatch
The object exists but is not of the expected type
MethodNotFound
The requested method does not exist on this object type
InvalidArgument
Invalid argument passed to object method
Implementations§
Source§impl ObjectError
impl ObjectError
Sourcepub fn not_found(handle: ObjectHandle) -> Self
pub fn not_found(handle: ObjectHandle) -> Self
Create a NotFound error
Sourcepub fn stale_handle(handle: ObjectHandle, current_generation: u32) -> Self
pub fn stale_handle(handle: ObjectHandle, current_generation: u32) -> Self
Create a StaleHandle error
Sourcepub fn type_mismatch(
handle: ObjectHandle,
expected: ObjectType,
actual: ObjectType,
) -> Self
pub fn type_mismatch( handle: ObjectHandle, expected: ObjectType, actual: ObjectType, ) -> Self
Create a TypeMismatch error
Sourcepub fn method_not_found(
handle: ObjectHandle,
method_name: impl Into<String>,
) -> Self
pub fn method_not_found( handle: ObjectHandle, method_name: impl Into<String>, ) -> Self
Create a MethodNotFound error
Sourcepub fn invalid_argument(
handle: ObjectHandle,
method_name: impl Into<String>,
argument: impl Into<String>,
reason: impl Into<String>,
) -> Self
pub fn invalid_argument( handle: ObjectHandle, method_name: impl Into<String>, argument: impl Into<String>, reason: impl Into<String>, ) -> Self
Create an InvalidArgument error
Trait Implementations§
Source§impl Clone for ObjectError
impl Clone for ObjectError
Source§fn clone(&self) -> ObjectError
fn clone(&self) -> ObjectError
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 moreSource§impl Debug for ObjectError
impl Debug for ObjectError
Source§impl Display for ObjectError
impl Display for ObjectError
Source§impl Error for ObjectError
impl Error for ObjectError
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()
Source§impl PartialEq for ObjectError
impl PartialEq for ObjectError
impl StructuralPartialEq for ObjectError
Auto Trait Implementations§
impl Freeze for ObjectError
impl RefUnwindSafe for ObjectError
impl Send for ObjectError
impl Sync for ObjectError
impl Unpin for ObjectError
impl UnsafeUnpin for ObjectError
impl UnwindSafe for ObjectError
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.