pub struct Dependency { /* private fields */ }Expand description
One typed dependency occurrence in a representation’s observed set.
Implementations§
Source§impl Dependency
impl Dependency
Sourcepub fn new(
source_resource_id: Option<ResourceId>,
kind: DependencyKind,
target: DependencyTarget,
resolved_representation_id: Option<RepresentationId>,
required: bool,
authored_reference: impl Into<String>,
) -> Result<Self>
pub fn new( source_resource_id: Option<ResourceId>, kind: DependencyKind, target: DependencyTarget, resolved_representation_id: Option<RepresentationId>, required: bool, authored_reference: impl Into<String>, ) -> Result<Self>
Creates one dependency occurrence.
The authored reference is preserved exactly and may be empty when the source format permits an implicit reference. A resolved representation applies only to a floating asset target; a representation target is already pinned.
§Errors
Returns an invalid-argument error for oversized or NUL-containing reference text, or a resolved representation on a pinned target.
Sourcepub const fn source_resource_id(&self) -> Option<ResourceId>
pub const fn source_resource_id(&self) -> Option<ResourceId>
Returns the resource that contains this reference, when known.
Sourcepub const fn kind(&self) -> &DependencyKind
pub const fn kind(&self) -> &DependencyKind
Returns the exact open-world relationship kind.
Sourcepub const fn target(&self) -> DependencyTarget
pub const fn target(&self) -> DependencyTarget
Returns the floating or pinned target.
Sourcepub const fn resolved_representation_id(&self) -> Option<RepresentationId>
pub const fn resolved_representation_id(&self) -> Option<RepresentationId>
Returns the representation selected for a floating asset target.
Sourcepub const fn is_required(&self) -> bool
pub const fn is_required(&self) -> bool
Returns whether the target is needed whenever the source is used.
Returns the reference text exactly as supplied by the caller.
Trait Implementations§
Source§impl Clone for Dependency
impl Clone for Dependency
Source§fn clone(&self) -> Dependency
fn clone(&self) -> Dependency
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more