pub struct Resource { /* private fields */ }Implementations§
Source§impl Resource
impl Resource
Sourcepub fn new<T: ResourceDefinition>(resource: T) -> Self
pub fn new<T: ResourceDefinition>(resource: T) -> Self
Creates a new Resource from any type that implements ResourceDefinition
Sourcepub fn from_boxed(boxed_resource: Box<dyn ResourceDefinition>) -> Self
pub fn from_boxed(boxed_resource: Box<dyn ResourceDefinition>) -> Self
Creates a new Resource from a boxed ResourceDefinition
Sourcepub fn resource_type(&self) -> ResourceType
pub fn resource_type(&self) -> ResourceType
Returns the resource type identifier
Sourcepub fn get_dependencies(&self) -> Vec<ResourceRef>
pub fn get_dependencies(&self) -> Vec<ResourceRef>
Returns the list of other resources this resource depends on
Sourcepub fn get_permissions(&self) -> Option<&str>
pub fn get_permissions(&self) -> Option<&str>
Returns the permission profile name for this resource, if it has one.
Sourcepub fn validate_update(&self, new_config: &Resource) -> Result<()>
pub fn validate_update(&self, new_config: &Resource) -> Result<()>
Validates if an update from the current configuration to a new configuration is allowed
Sourcepub fn as_resource_definition(&self) -> &dyn ResourceDefinition
pub fn as_resource_definition(&self) -> &dyn ResourceDefinition
Provides access to the underlying ResourceDefinition trait object
Sourcepub fn downcast_ref<T: ResourceDefinition + 'static>(&self) -> Option<&T>
pub fn downcast_ref<T: ResourceDefinition + 'static>(&self) -> Option<&T>
Generic downcasting for any type
Sourcepub fn downcast_mut<T: ResourceDefinition + 'static>(
&mut self,
) -> Option<&mut T>
pub fn downcast_mut<T: ResourceDefinition + 'static>( &mut self, ) -> Option<&mut T>
Generic mutable downcasting for any type
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<&Resource> for ResourceRef
impl From<&Resource> for ResourceRef
impl Eq 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.