pub struct Capability {
pub resource: ResourceKind,
pub strategy: Strategy,
pub path: RelPath,
pub note: Option<String>,
pub fallback: Option<Fallback>,
}Expand description
How one provider obtains one resource.
Fields§
§resource: ResourceKind§strategy: Strategy§path: RelPathWhere this provider expects to find the resource.
note: Option<String>§fallback: Option<Fallback>Used when the preferred strategy is impossible on the host.
Implementations§
Source§impl Capability
impl Capability
Sourcepub fn import_body(&self, canonical: &RelPath) -> Option<String>
pub fn import_body(&self, canonical: &RelPath) -> Option<String>
Renders the import stub contents for this capability.
Returns None when this capability has no import path at all. An inline
template on an import capability is normalised into fallback at
parse time, so there is exactly one place to read it from.
Sourcepub fn has_import_fallback(&self) -> bool
pub fn has_import_fallback(&self) -> bool
Whether this capability can degrade to an import stub when the host
cannot create the link it would prefer.
Trait Implementations§
Source§impl Clone for Capability
impl Clone for Capability
Source§fn clone(&self) -> Capability
fn clone(&self) -> Capability
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Capability
impl Debug for Capability
impl Eq for Capability
Source§impl PartialEq for Capability
impl PartialEq for Capability
impl StructuralPartialEq for Capability
Auto Trait Implementations§
impl Freeze for Capability
impl RefUnwindSafe for Capability
impl Send for Capability
impl Sync for Capability
impl Unpin for Capability
impl UnsafeUnpin for Capability
impl UnwindSafe for Capability
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