pub struct LinearResource {
pub resource_type: LinearType,
pub capabilities: HashSet<Capability>,
}Expand description
Linear resource with capabilities.
Fields§
§resource_type: LinearTypeResource type
capabilities: HashSet<Capability>Allowed capabilities
Implementations§
Source§impl LinearResource
impl LinearResource
pub fn new(resource_type: LinearType, capabilities: HashSet<Capability>) -> Self
Sourcepub fn has_capability(&self, cap: &Capability) -> bool
pub fn has_capability(&self, cap: &Capability) -> bool
Check if a capability is allowed
Sourcepub fn read_only(resource_type: LinearType) -> Self
pub fn read_only(resource_type: LinearType) -> Self
Create a read-only resource
Sourcepub fn read_write(resource_type: LinearType) -> Self
pub fn read_write(resource_type: LinearType) -> Self
Create a read-write resource
Sourcepub fn owned(resource_type: LinearType) -> Self
pub fn owned(resource_type: LinearType) -> Self
Create an owned resource (full access)
Trait Implementations§
Source§impl Clone for LinearResource
impl Clone for LinearResource
Source§fn clone(&self) -> LinearResource
fn clone(&self) -> LinearResource
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LinearResource
impl Debug for LinearResource
Source§impl<'de> Deserialize<'de> for LinearResource
impl<'de> Deserialize<'de> for LinearResource
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 PartialEq for LinearResource
impl PartialEq for LinearResource
Source§impl Serialize for LinearResource
impl Serialize for LinearResource
impl Eq for LinearResource
impl StructuralPartialEq for LinearResource
Auto Trait Implementations§
impl Freeze for LinearResource
impl RefUnwindSafe for LinearResource
impl Send for LinearResource
impl Sync for LinearResource
impl Unpin for LinearResource
impl UnwindSafe for LinearResource
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