pub enum Resource {
Goal(Goal),
Plan(Plan),
Capability(Capability),
Binding(Binding),
Execution(Execution),
Gate(Gate),
}Expand description
Resource is an enum that can hold any PlanSpec resource type.
Uses untagged serialization since each resource type has its own kind field.
Variants§
Goal(Goal)
A Goal resource.
Plan(Plan)
A Plan resource.
Capability(Capability)
A Capability resource.
Binding(Binding)
A Binding resource.
Execution(Execution)
An Execution resource.
Gate(Gate)
A Gate resource.
Implementations§
Source§impl Resource
impl Resource
Sourcepub fn metadata(&self) -> &ObjectMeta
pub fn metadata(&self) -> &ObjectMeta
Get the metadata of this resource.
Sourcepub fn metadata_mut(&mut self) -> &mut ObjectMeta
pub fn metadata_mut(&mut self) -> &mut ObjectMeta
Get a mutable reference to the metadata of this resource.
Sourcepub fn api_version(&self) -> &str
pub fn api_version(&self) -> &str
Get the API version of this resource.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Resource
impl<'de> Deserialize<'de> for Resource
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 From<Capability> for Resource
impl From<Capability> for Resource
Source§fn from(capability: Capability) -> Self
fn from(capability: Capability) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for Resource
Auto Trait Implementations§
impl Freeze for Resource
impl RefUnwindSafe for Resource
impl Send for Resource
impl Sync for Resource
impl Unpin for Resource
impl UnsafeUnpin for Resource
impl UnwindSafe for Resource
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