pub struct ContainerGrant {
pub path: ContainerPath,
pub modes: Vec<AclMode>,
pub operations: Vec<PodMethod>,
}Expand description
One granted container: its path, the modes and the operations.
§Examples
use stratum_node_core::{AclMode, ContainerGrant, PodMethod};
let grant: ContainerGrant = serde_json::from_str(
r#"{"path":"reports/","modes":["Read","Write"],"operations":["GET","PUT"]}"#,
)?;
assert!(grant.allows(PodMethod::Put));
assert!(!grant.allows(PodMethod::Delete));
assert_eq!(grant.modes, [AclMode::Read, AclMode::Write]);Fields§
§path: ContainerPathThe container, relative to the pod root.
modes: Vec<AclMode>[Read] or [Read, Write].
operations: Vec<PodMethod>The operations allowed on the container and below it.
Implementations§
Trait Implementations§
Source§impl Clone for ContainerGrant
impl Clone for ContainerGrant
Source§impl Debug for ContainerGrant
impl Debug for ContainerGrant
Source§impl<'de> Deserialize<'de> for ContainerGrant
impl<'de> Deserialize<'de> for ContainerGrant
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
impl Eq for ContainerGrant
Source§impl Hash for ContainerGrant
impl Hash for ContainerGrant
Source§impl PartialEq for ContainerGrant
impl PartialEq for ContainerGrant
Source§impl Serialize for ContainerGrant
impl Serialize for ContainerGrant
impl StructuralPartialEq for ContainerGrant
Auto Trait Implementations§
impl Forget for ContainerGrant
impl Freeze for ContainerGrantwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<AclMode>: Freeze,
PhantomData<PodMethod>: Freeze,
impl Move for ContainerGrant
impl RefUnwindSafe for ContainerGrant
impl Send for ContainerGrantwhere
RawVecInner: Send,
impl Sync for ContainerGrantwhere
RawVecInner: Sync,
impl Unpin for ContainerGrant
impl UnsafeUnpin for ContainerGrantwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<AclMode>: UnsafeUnpin,
PhantomData<PodMethod>: UnsafeUnpin,
impl UnwindSafe for ContainerGrantwhere
RawVecInner: 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