Struct bonsaidb_core::admin::PermissionGroup
source · pub struct PermissionGroup { /* private fields */ }
Expand description
A named group of permissions statements.
Implementations§
source§impl 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§
source§impl Clone for PermissionGroup
impl Clone for PermissionGroup
source§fn clone(&self) -> PermissionGroup
fn clone(&self) -> PermissionGroup
Returns a copy 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 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
source§fn collection_name() -> CollectionName
fn collection_name() -> CollectionName
The unique name of this collection. Each collection must be uniquely
named within the
Schema
it is registered
within.source§impl Debug for PermissionGroup
impl Debug for PermissionGroup
source§impl DefaultSerialization for PermissionGroup
impl DefaultSerialization for PermissionGroup
source§fn 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.source§impl<'de> Deserialize<'de> for PermissionGroup
impl<'de> Deserialize<'de> for PermissionGroup
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 NamedCollection for PermissionGroup
impl NamedCollection for PermissionGroup
§type ByNameView = ByName
type ByNameView = ByName
The name view defined for the collection.
source§fn load<'name, N: Nameable<'name, Self::PrimaryKey> + Send + Sync, C: Connection>(
id: N,
connection: &C
) -> Result<Option<CollectionDocument<Self>>, Error>where
Self: SerializedCollection + Sized + 'static,
fn load<'name, N: Nameable<'name, Self::PrimaryKey> + Send + Sync, C: Connection>( id: N, connection: &C ) -> Result<Option<CollectionDocument<Self>>, Error>where Self: SerializedCollection + Sized + 'static,
source§fn load_async<'name, 'life0, 'async_trait, N, C>(
id: N,
connection: &'life0 C
) -> Pin<Box<dyn Future<Output = Result<Option<CollectionDocument<Self>>, Error>> + Send + 'async_trait>>where
Self: SerializedCollection + Sized + 'static + Send + 'async_trait,
N: 'async_trait + Nameable<'name, Self::PrimaryKey> + Send + Sync,
C: 'async_trait + AsyncConnection,
'name: 'async_trait,
'life0: 'async_trait,
fn load_async<'name, 'life0, 'async_trait, N, C>( id: N, connection: &'life0 C ) -> Pin<Box<dyn Future<Output = Result<Option<CollectionDocument<Self>>, Error>> + Send + 'async_trait>>where Self: SerializedCollection + Sized + 'static + Send + 'async_trait, N: 'async_trait + Nameable<'name, Self::PrimaryKey> + Send + Sync, C: 'async_trait + AsyncConnection, 'name: 'async_trait, 'life0: 'async_trait,
source§fn entry<'connection, 'name, N: Into<NamedReference<'name, Self::PrimaryKey>> + Send + Sync, C: Connection>(
id: N,
connection: &'connection C
) -> Entry<'connection, 'name, C, Self, (), ()>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, (), ()>where Self: SerializedCollection + Sized,
source§fn entry_async<'connection, 'name, N: Into<NamedReference<'name, Self::PrimaryKey>> + Send + Sync, C: AsyncConnection>(
id: N,
connection: &'connection C
) -> AsyncEntry<'connection, 'name, C, Self, (), ()> ⓘwhere
Self: SerializedCollection + Sized,
fn entry_async<'connection, 'name, N: Into<NamedReference<'name, Self::PrimaryKey>> + Send + Sync, C: AsyncConnection>( id: N, connection: &'connection C ) -> AsyncEntry<'connection, 'name, C, Self, (), ()> ⓘwhere Self: SerializedCollection + Sized,
source§fn load_document<'name, N: Nameable<'name, Self::PrimaryKey> + Send + Sync, C: Connection>(
name: N,
connection: &C
) -> Result<Option<OwnedDocument>, Error>where
Self: SerializedCollection + Sized,
fn load_document<'name, N: Nameable<'name, Self::PrimaryKey> + Send + Sync, C: Connection>( name: N, connection: &C ) -> Result<Option<OwnedDocument>, Error>where Self: SerializedCollection + Sized,
Loads a document from this collection by name, if applicable. Return
Ok(None)
if unsupported.source§fn load_document_async<'name, 'life0, 'async_trait, N, C>(
name: N,
connection: &'life0 C
) -> Pin<Box<dyn Future<Output = Result<Option<OwnedDocument>, Error>> + Send + 'async_trait>>where
Self: SerializedCollection + Sized + Send + 'async_trait,
N: 'async_trait + Nameable<'name, Self::PrimaryKey> + Send + Sync,
C: 'async_trait + AsyncConnection,
'name: 'async_trait,
'life0: 'async_trait,
fn load_document_async<'name, 'life0, 'async_trait, N, C>( name: N, connection: &'life0 C ) -> Pin<Box<dyn Future<Output = Result<Option<OwnedDocument>, Error>> + Send + 'async_trait>>where Self: SerializedCollection + Sized + Send + 'async_trait, N: 'async_trait + Nameable<'name, Self::PrimaryKey> + Send + Sync, C: 'async_trait + AsyncConnection, 'name: 'async_trait, 'life0: 'async_trait,
Loads a document from this collection by name, if applicable. Return
Ok(None)
if unsupported.source§fn delete_by_name<C: Connection>(
name: &str,
connection: &C
) -> Result<bool, Error>where
Self: SerializedCollection + Sized,
fn delete_by_name<C: Connection>( name: &str, connection: &C ) -> Result<bool, Error>where Self: SerializedCollection + Sized,
Deletes a document by its name. Returns true if a document was deleted.
source§fn delete_by_name_async<'life0, 'life1, 'async_trait, C>(
name: &'life0 str,
connection: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
Self: SerializedCollection + Sized + Send + 'async_trait,
C: 'async_trait + AsyncConnection,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_by_name_async<'life0, 'life1, 'async_trait, C>( name: &'life0 str, connection: &'life1 C ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where Self: SerializedCollection + Sized + Send + 'async_trait, C: 'async_trait + AsyncConnection, 'life0: 'async_trait, 'life1: 'async_trait,
Deletes a document by its name. Returns true if a document was deleted.
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§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Schema for Twhere
T: Collection + 'static,
impl<T> Schema for Twhere T: Collection + 'static,
source§fn schema_name() -> SchemaName
fn schema_name() -> SchemaName
Returns the unique
SchemaName
for this schema.