pub struct Object {
pub namespace: String,
pub id: String,
}Expand description
Represents a namespaced digital object.
e.g., doc:readme, folder:A
Fields§
§namespace: StringObject namespace/type.
id: StringObject identifier within the namespace.
Implementations§
Source§impl Object
impl Object
Sourcepub fn new(namespace: impl Into<String>, id: impl Into<String>) -> Self
pub fn new(namespace: impl Into<String>, id: impl Into<String>) -> Self
Creates a namespaced object.
Sourcepub fn validate(&self) -> Result<(), DomainError>
pub fn validate(&self) -> Result<(), DomainError>
Validates this object’s namespace and identifier.
§Errors
Returns DomainError when the namespace or object id violates the public identifier
grammar or byte limits.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Object
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Object
Available on crate feature
serde only.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 Object
impl StructuralPartialEq for Object
Auto Trait Implementations§
impl Freeze for Object
impl RefUnwindSafe for Object
impl Send for Object
impl Sync for Object
impl Unpin for Object
impl UnsafeUnpin for Object
impl UnwindSafe for Object
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