pub struct InterfaceReference {
pub scope: String,
pub name: String,
}Expand description
An interface identified by an exact (scope, name) pair in one Worldspace.
Neither field is normalized, case-folded, URL-decoded, or split on display delimiters. Descriptor identity is external to the descriptor itself.
use wip_protocol::{FetchInterfaceRequest, InterfaceReference};
let reference = InterfaceReference {
scope: "/世::界/#".into(),
name: "read::書く#λ".into(),
};
reference.validate_for_path("/世::界/#/item")?;
// Fetching is independent of an Object target path.
FetchInterfaceRequest { interface: reference }.validate()?;Fields§
§scope: StringCanonical absolute Worldspace path of the interface’s scope Object.
name: StringNonempty Unicode local name, with no delimiter restrictions.
Implementations§
Source§impl InterfaceReference
impl InterfaceReference
Sourcepub fn validate(&self) -> Result<(), ValidationError>
pub fn validate(&self) -> Result<(), ValidationError>
Validates reference shape without requiring a target Object path.
Sourcepub fn validate_for_path(&self, path: &str) -> Result<(), ValidationError>
pub fn validate_for_path(&self, path: &str) -> Result<(), ValidationError>
Validates shape and that scope is an ancestor-or-self of path.
This is independent of indexability. A Host maps a valid reference’s
scope mismatch to InterfaceMismatch at the interface-selection stage,
not to the earlier shape-validation InvalidRequest stage.
Trait Implementations§
Source§impl Clone for InterfaceReference
impl Clone for InterfaceReference
Source§impl Debug for InterfaceReference
impl Debug for InterfaceReference
impl Eq for InterfaceReference
Source§impl Hash for InterfaceReference
impl Hash for InterfaceReference
Source§impl Ord for InterfaceReference
impl Ord for InterfaceReference
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for InterfaceReference
impl PartialEq for InterfaceReference
Source§impl PartialOrd for InterfaceReference
impl PartialOrd for InterfaceReference
impl StructuralPartialEq for InterfaceReference
Auto Trait Implementations§
impl Freeze for InterfaceReference
impl RefUnwindSafe for InterfaceReference
impl Send for InterfaceReference
impl Sync for InterfaceReference
impl Unpin for InterfaceReference
impl UnsafeUnpin for InterfaceReference
impl UnwindSafe for InterfaceReference
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