Enum compose_spec::Resource
source · pub enum Resource<T> {
External {
name: Option<String>,
},
Compose(T),
}Expand description
Variants§
External
Externally managed resource.
(De)serializes from/to the mapping external: true with an optional name entry.
Compose(T)
Resource manged by the compose implementation.
Implementations§
source§impl<T> Resource<T>
impl<T> Resource<T>
sourcepub const fn external(name: Option<String>) -> Self
pub const fn external(name: Option<String>) -> Self
Create a Resource::External with an optional name.
sourcepub const fn is_external(&self) -> bool
pub const fn is_external(&self) -> bool
Returns true if the resource is External.
sourcepub const fn is_compose(&self) -> bool
pub const fn is_compose(&self) -> bool
Returns true if the resource is managed by the Compose implementation.
Trait Implementations§
source§impl<'de, T: Deserialize<'de>> Deserialize<'de> for Resource<T>
impl<'de, T: Deserialize<'de>> Deserialize<'de> for Resource<T>
source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl<T: PartialEq> PartialEq for Resource<T>
impl<T: PartialEq> PartialEq for Resource<T>
impl<T: Eq> Eq for Resource<T>
impl<T> StructuralPartialEq for Resource<T>
Auto Trait Implementations§
impl<T> Freeze for Resource<T>where
T: Freeze,
impl<T> RefUnwindSafe for Resource<T>where
T: RefUnwindSafe,
impl<T> Send for Resource<T>where
T: Send,
impl<T> Sync for Resource<T>where
T: Sync,
impl<T> Unpin for Resource<T>where
T: Unpin,
impl<T> UnwindSafe for Resource<T>where
T: UnwindSafe,
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<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.