Struct bonsaidb_core::admin::PermissionGroup
source · [−]Expand description
A named group of permissions statements.
Fields
name: StringThe name of the group. Must be unique.
statements: Vec<Statement>The permission statements.
Implementations
sourceimpl PermissionGroup
impl PermissionGroup
sourcepub fn named<S: Into<String>>(name: S) -> Self
pub fn named<S: Into<String>>(name: S) -> Self
Returns a new group with no statements and the name provided.
sourcepub fn with_group_ids<I: IntoIterator<Item = Statement>>(
self,
statements: I
) -> Self
pub fn with_group_ids<I: IntoIterator<Item = Statement>>(
self,
statements: I
) -> Self
Builder-style method. Returns self after replacing the current statements with statements.
Trait Implementations
sourceimpl Clone for PermissionGroup
impl Clone for PermissionGroup
sourcefn clone(&self) -> PermissionGroup
fn clone(&self) -> PermissionGroup
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Collection for PermissionGroup
impl Collection for PermissionGroup
type PrimaryKey = u64
type PrimaryKey = u64
The unique id type. Each document stored in a collection will be uniquely identified by this type. Read more
sourcefn collection_name() -> CollectionName
fn collection_name() -> CollectionName
sourceimpl Debug for PermissionGroup
impl Debug for PermissionGroup
sourceimpl DefaultSerialization for PermissionGroup
impl DefaultSerialization for PermissionGroup
sourcefn natural_id(&self) -> Option<Self::PrimaryKey>
fn natural_id(&self) -> Option<Self::PrimaryKey>
Returns the natural identifier of contents. This is called when
pushing values into a collection, before attempting to automatically
assign a unique id. Read more
sourceimpl<'de> Deserialize<'de> for PermissionGroup
impl<'de> Deserialize<'de> for PermissionGroup
sourcefn 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
sourceimpl NamedCollection for PermissionGroup
impl NamedCollection for PermissionGroup
type ByNameView = ByName
type ByNameView = ByName
The name view defined for the collection.
sourcefn load<'name, 'life0, 'async_trait, N: Nameable<'name, Self::PrimaryKey> + Send + Sync, C: Connection>(
id: N,
connection: &'life0 C
) -> Pin<Box<dyn Future<Output = Result<Option<CollectionDocument<Self>>, Error>> + Send + 'async_trait>> where
Self: SerializedCollection + Sized + 'static,
'name: 'async_trait,
N: 'async_trait,
C: 'async_trait,
'life0: 'async_trait,
Self: Send + 'async_trait,
fn load<'name, 'life0, 'async_trait, N: Nameable<'name, Self::PrimaryKey> + Send + Sync, C: Connection>(
id: N,
connection: &'life0 C
) -> Pin<Box<dyn Future<Output = Result<Option<CollectionDocument<Self>>, Error>> + Send + 'async_trait>> where
Self: SerializedCollection + Sized + 'static,
'name: 'async_trait,
N: 'async_trait,
C: 'async_trait,
'life0: 'async_trait,
Self: Send + 'async_trait,
Gets a CollectionDocument with id from connection.
sourcefn entry<'connection, 'name, N: Into<NamedReference<'name, Self::PrimaryKey>> + Send + Sync, C: Connection>(
id: N,
connection: &'connection C
) -> Entry<'connection, 'name, C, Self, (), ()>ⓘNotable traits for Entry<'a, 'name, Conn, Col, EI, EU>impl<'a, 'name, Conn, Col, EI, EU> Future for Entry<'a, 'name, Conn, Col, EI, EU> where
Col: NamedCollection + SerializedCollection + 'static,
<Col as Collection>::PrimaryKey: Unpin,
Conn: Connection,
EI: EntryInsert<Col> + 'a,
EU: EntryUpdate<Col> + 'a,
'name: 'a, type Output = Result<Option<CollectionDocument<Col>>, Error>; where
Self: SerializedCollection + Sized,
fn entry<'connection, 'name, N: Into<NamedReference<'name, Self::PrimaryKey>> + Send + Sync, C: Connection>(
id: N,
connection: &'connection C
) -> Entry<'connection, 'name, C, Self, (), ()>ⓘNotable traits for Entry<'a, 'name, Conn, Col, EI, EU>impl<'a, 'name, Conn, Col, EI, EU> Future for Entry<'a, 'name, Conn, Col, EI, EU> where
Col: NamedCollection + SerializedCollection + 'static,
<Col as Collection>::PrimaryKey: Unpin,
Conn: Connection,
EI: EntryInsert<Col> + 'a,
EU: EntryUpdate<Col> + 'a,
'name: 'a, type Output = Result<Option<CollectionDocument<Col>>, Error>; where
Self: SerializedCollection + Sized,
Col: NamedCollection + SerializedCollection + 'static,
<Col as Collection>::PrimaryKey: Unpin,
Conn: Connection,
EI: EntryInsert<Col> + 'a,
EU: EntryUpdate<Col> + 'a,
'name: 'a, type Output = Result<Option<CollectionDocument<Col>>, Error>;
Gets a CollectionDocument with id from connection.
sourcefn load_document<'name, 'life0, 'async_trait, N: Nameable<'name, Self::PrimaryKey> + Send + Sync, C: Connection>(
name: N,
connection: &'life0 C
) -> Pin<Box<dyn Future<Output = Result<Option<OwnedDocument>, Error>> + Send + 'async_trait>> where
Self: SerializedCollection + Sized,
'name: 'async_trait,
N: 'async_trait,
C: 'async_trait,
'life0: 'async_trait,
Self: Send + 'async_trait,
fn load_document<'name, 'life0, 'async_trait, N: Nameable<'name, Self::PrimaryKey> + Send + Sync, C: Connection>(
name: N,
connection: &'life0 C
) -> Pin<Box<dyn Future<Output = Result<Option<OwnedDocument>, Error>> + Send + 'async_trait>> where
Self: SerializedCollection + Sized,
'name: 'async_trait,
N: 'async_trait,
C: 'async_trait,
'life0: 'async_trait,
Self: Send + 'async_trait,
Loads a document from this collection by name, if applicable. Return
Ok(None) if unsupported. Read more
sourceimpl Serialize for PermissionGroup
impl Serialize for PermissionGroup
Auto Trait Implementations
impl RefUnwindSafe for PermissionGroup
impl Send for PermissionGroup
impl Sync for PermissionGroup
impl Unpin for PermissionGroup
impl UnwindSafe for PermissionGroup
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Schema for T where
T: 'static + Collection,
impl<T> Schema for T where
T: 'static + Collection,
sourcefn schema_name() -> SchemaName
fn schema_name() -> SchemaName
Returns the unique SchemaName for this schema.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more