pub struct TargetRef { /* private fields */ }Expand description
Stable, serializable reference to an operation target.
Implementations§
Source§impl TargetRef
impl TargetRef
Sourcepub fn new(
kind: TargetKind,
id: impl Into<String>,
) -> Result<Self, TargetRefError>
pub fn new( kind: TargetKind, id: impl Into<String>, ) -> Result<Self, TargetRefError>
Creates a target reference with a validated resource identity.
Sourcepub fn with_host(self, host: impl Into<String>) -> Result<Self, TargetRefError>
pub fn with_host(self, host: impl Into<String>) -> Result<Self, TargetRefError>
Associates the target with an explicit host identity.
Sourcepub fn with_parent(self, parent: TargetRef) -> Result<Self, TargetRefError>
pub fn with_parent(self, parent: TargetRef) -> Result<Self, TargetRefError>
Associates the target with a parent resource.
Sourcepub fn with_revision(
self,
revision: impl Into<String>,
) -> Result<Self, TargetRefError>
pub fn with_revision( self, revision: impl Into<String>, ) -> Result<Self, TargetRefError>
Binds the target to a topology or resource revision.
Sourcepub fn kind(&self) -> &TargetKind
pub fn kind(&self) -> &TargetKind
Returns the target category.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TargetRef
impl<'de> Deserialize<'de> for TargetRef
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
Source§impl JsonSchema for TargetRef
impl JsonSchema for TargetRef
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Ord for TargetRef
impl Ord for TargetRef
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
Source§impl PartialOrd for TargetRef
impl PartialOrd for TargetRef
impl Eq for TargetRef
impl StructuralPartialEq for TargetRef
Auto Trait Implementations§
impl Freeze for TargetRef
impl RefUnwindSafe for TargetRef
impl Send for TargetRef
impl Sync for TargetRef
impl Unpin for TargetRef
impl UnsafeUnpin for TargetRef
impl UnwindSafe for TargetRef
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.