Struct bonsaidb_server::CustomServer
source · pub struct CustomServer<B: Backend = NoBackend> { /* private fields */ }
Expand description
A BonsaiDb server.
Implementations§
source§impl<B: Backend> CustomServer<B>
impl<B: Backend> CustomServer<B>
sourcepub async fn listen_for_tcp_on<S: TcpService, T: ToSocketAddrs + Send + Sync>(
&self,
addr: T,
service: S
) -> Result<(), Error>
pub async fn listen_for_tcp_on<S: TcpService, T: ToSocketAddrs + Send + Sync>( &self, addr: T, service: S ) -> Result<(), Error>
Listens for HTTP traffic on port
. This port will also receive
WebSocket
connections if feature websockets
is enabled.
sourcepub async fn listen_for_secure_tcp_on<S: TcpService, T: ToSocketAddrs + Send + Sync>(
&self,
addr: T,
service: S
) -> Result<(), Error>
pub async fn listen_for_secure_tcp_on<S: TcpService, T: ToSocketAddrs + Send + Sync>( &self, addr: T, service: S ) -> Result<(), Error>
Listens for HTTPS traffic on port
. This port will also receive
WebSocket
connections if feature websockets
is enabled. If feature
acme
is enabled, this connection will automatically manage the
server’s private key and certificate, which is also used for the
QUIC-based protocol.
source§impl<B: Backend> CustomServer<B>
impl<B: Backend> CustomServer<B>
sourcepub async fn listen_for_websockets_on<T: ToSocketAddrs + Send + Sync>(
&self,
addr: T,
with_tls: bool
) -> Result<(), Error>
pub async fn listen_for_websockets_on<T: ToSocketAddrs + Send + Sync>( &self, addr: T, with_tls: bool ) -> Result<(), Error>
Listens for websocket connections on addr
.
sourcepub fn upgrade_websocket(
&self,
peer_address: SocketAddr,
request: Request<Body>
) -> Response<Body>
pub fn upgrade_websocket( &self, peer_address: SocketAddr, request: Request<Body> ) -> Response<Body>
Handles upgrading an HTTP connection to the WebSocket
protocol based
on the upgrade request
. Requires feature hyper
to be enabled.
sourcepub async fn handle_websocket<S: Stream<Item = Result<Message, E>> + Sink<Message> + Send + 'static, E: Debug + Send>(
&self,
connection: S,
peer_address: SocketAddr
)
pub async fn handle_websocket<S: Stream<Item = Result<Message, E>> + Sink<Message> + Send + 'static, E: Debug + Send>( &self, connection: S, peer_address: SocketAddr )
Handles an established tokio-tungstenite
WebSocket
stream.
source§impl<B: Backend> CustomServer<B>
impl<B: Backend> CustomServer<B>
sourcepub async fn open(
configuration: ServerConfiguration<B>
) -> Result<Self, BackendError<B::Error>>
pub async fn open( configuration: ServerConfiguration<B> ) -> Result<Self, BackendError<B::Error>>
Opens a server using directory
for storage.
sourcepub fn pinned_certificate_path(&self) -> PathBuf
pub fn pinned_certificate_path(&self) -> PathBuf
Returns the path to the public pinned certificate, if this server has one. Note: this function will always succeed, but the file may not exist.
sourcepub fn primary_domain(&self) -> &str
pub fn primary_domain(&self) -> &str
Returns the primary domain configured for this server.
sourcepub async fn admin(&self) -> ServerDatabase<B>
pub async fn admin(&self) -> ServerDatabase<B>
Returns the administration database.
sourcepub async fn install_self_signed_certificate(
&self,
overwrite: bool
) -> Result<(), Error>
pub async fn install_self_signed_certificate( &self, overwrite: bool ) -> Result<(), Error>
Installs an X.509 certificate used for general purpose connections.
sourcepub async fn install_pem_certificate(
&self,
certificate_chain: &[u8],
private_key: &[u8]
) -> Result<(), Error>
pub async fn install_pem_certificate( &self, certificate_chain: &[u8], private_key: &[u8] ) -> Result<(), Error>
Installs a certificate chain and private key used for TLS connections.
sourcepub async fn install_certificate(
&self,
certificate_chain: &CertificateChain,
private_key: &PrivateKey
) -> Result<(), Error>
pub async fn install_certificate( &self, certificate_chain: &CertificateChain, private_key: &PrivateKey ) -> Result<(), Error>
Installs a certificate chain and private key used for TLS connections.
sourcepub async fn certificate_chain(&self) -> Result<CertificateChain, Error>
pub async fn certificate_chain(&self) -> Result<CertificateChain, Error>
Returns the current certificate chain.
sourcepub async fn listen_on(
&self,
config: impl Into<BonsaiListenConfig>
) -> Result<(), Error>
pub async fn listen_on( &self, config: impl Into<BonsaiListenConfig> ) -> Result<(), Error>
Listens for incoming client connections. Does not return until the server shuts down.
Listening on a port
When passing a u16
to this function, the server will begin listening
on an “unspecified” address. This typically is accessible to other
machines on the network/internet, so care should be taken to ensure this
is what is intended.
To ensure that the server only listens for local traffic, specify a local IP or localhost in addition to the port number.
sourcepub fn connected_clients(&self) -> Vec<ConnectedClient<B>>
pub fn connected_clients(&self) -> Vec<ConnectedClient<B>>
Returns all of the currently connected clients.
sourcepub fn broadcast<Api: Api>(&self, response: &Api::Response)
pub fn broadcast<Api: Api>(&self, response: &Api::Response)
Sends a custom API response to all connected clients.
sourcepub async fn shutdown(&self, timeout: Option<Duration>) -> Result<(), Error>
pub async fn shutdown(&self, timeout: Option<Duration>) -> Result<(), Error>
Shuts the server down. If a timeout
is provided, the server will stop
accepting new connections and attempt to respond to any outstanding
requests already being processed. After the timeout
has elapsed or if
no timeout
was provided, the server is forcefully shut down.
sourcepub async fn listen_for_shutdown(&self) -> Result<(), Error>
pub async fn listen_for_shutdown(&self) -> Result<(), Error>
Listens for signals from the operating system that the server should shut down and attempts to gracefully shut down.
Methods from Deref<Target = AsyncStorage>§
pub async fn restore<L>(
&self,
location: L
) -> impl Future<Output = Result<(), Error>>where
L: AnyBackupLocation + 'static,
pub async fn restore<L>( &self, location: L ) -> impl Future<Output = Result<(), Error>>where L: AnyBackupLocation + 'static,
Restores all data from a previously stored backup location
.
pub async fn backup<L>(
&self,
location: L
) -> impl Future<Output = Result<(), Error>>where
L: AnyBackupLocation + 'static,
pub async fn backup<L>( &self, location: L ) -> impl Future<Output = Result<(), Error>>where L: AnyBackupLocation + 'static,
Stores a copy of all data in this instance to location
.
pub fn with_effective_permissions(
&self,
effective_permissions: Permissions
) -> Option<AsyncStorage>
pub fn with_effective_permissions( &self, effective_permissions: Permissions ) -> Option<AsyncStorage>
Restricts an unauthenticated instance to having effective_permissions
.
Returns None
if a session has already been established.
pub fn to_blocking(&self) -> Storage
pub fn to_blocking(&self) -> Storage
Converts this instance into its blocking version, which is able to be used without async.
pub fn as_blocking(&self) -> &Storage
pub fn as_blocking(&self) -> &Storage
Returns a reference to this instance’s blocking version, which is able to be used without async.
Trait Implementations§
source§impl<B: Backend> AcmeCache for CustomServer<B>
impl<B: Backend> AcmeCache for CustomServer<B>
source§fn read_account<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
contacts: &'life1 [&'life2 str]
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn read_account<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, contacts: &'life1 [&'life2 str] ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,
contacts
, if any. This
function should return None
instead of erroring if data was not
previously written for contacts
.source§fn write_account<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
contacts: &'life1 [&'life2 str],
contents: &'life3 [u8]
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn write_account<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, contacts: &'life1 [&'life2 str], contents: &'life3 [u8] ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,
data
for contacts
. The data being written is unique for the
combined list of contacts
. Read moresource§fn write_certificate<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
_domains: &'life1 [String],
_directory_url: &'life2 str,
key_pem: &'life3 str,
certificate_pem: &'life4 str
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn write_certificate<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, _domains: &'life1 [String], _directory_url: &'life2 str, key_pem: &'life3 str, certificate_pem: &'life4 str ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,
Acme
. The parameters are: Read moresource§impl<B: Backend> AsyncStorageConnection for CustomServer<B>
impl<B: Backend> AsyncStorageConnection for CustomServer<B>
§type Authenticated = CustomServer<B>
type Authenticated = CustomServer<B>
StorageConnection
] type returned from authentication calls.§type Database = ServerDatabase<B>
type Database = ServerDatabase<B>
source§fn admin<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Self::Database> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn admin<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Self::Database> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
source§fn create_database_with_schema<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
schema: SchemaName,
only_if_needed: bool
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_database_with_schema<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, schema: SchemaName, only_if_needed: bool ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
source§fn database<'life0, 'life1, 'async_trait, DB>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Self::Database, Error>> + Send + 'async_trait>>where
DB: 'async_trait + Schema,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn database<'life0, 'life1, 'async_trait, DB>( &'life0 self, name: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<Self::Database, Error>> + Send + 'async_trait>>where DB: 'async_trait + Schema, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
name
with schema DB
.source§fn delete_database<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_database<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
name
. Read moresource§fn list_databases<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<Database>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_databases<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<Database>, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
source§fn list_available_schemas<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<SchemaSummary>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_available_schemas<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<SchemaSummary>, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
SchemaName
]s registered with this storage.source§fn create_user<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_user<'life0, 'life1, 'async_trait>( &'life0 self, username: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
source§fn delete_user<'user, 'life0, 'async_trait, U>(
&'life0 self,
user: U
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
U: 'async_trait + Nameable<'user, u64> + Send + Sync,
Self: 'async_trait,
'user: 'async_trait,
'life0: 'async_trait,
fn delete_user<'user, 'life0, 'async_trait, U>( &'life0 self, user: U ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where U: 'async_trait + Nameable<'user, u64> + Send + Sync, Self: 'async_trait, 'user: 'async_trait, 'life0: 'async_trait,
source§fn set_user_password<'user, 'life0, 'async_trait, U>(
&'life0 self,
user: U,
password: SensitiveString
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
U: 'async_trait + Nameable<'user, u64> + Send + Sync,
Self: 'async_trait,
'user: 'async_trait,
'life0: 'async_trait,
fn set_user_password<'user, 'life0, 'async_trait, U>( &'life0 self, user: U, password: SensitiveString ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where U: 'async_trait + Nameable<'user, u64> + Send + Sync, Self: 'async_trait, 'user: 'async_trait, 'life0: 'async_trait,
source§fn authenticate<'life0, 'async_trait>(
&'life0 self,
authentication: Authentication
) -> Pin<Box<dyn Future<Output = Result<Self::Authenticated, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn authenticate<'life0, 'async_trait>( &'life0 self, authentication: Authentication ) -> Pin<Box<dyn Future<Output = Result<Self::Authenticated, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
AuthenticationToken
. If
successful, the returned instance will have the permissions from
identity
.source§fn assume_identity<'life0, 'life1, 'async_trait>(
&'life0 self,
identity: IdentityReference<'life1>
) -> Pin<Box<dyn Future<Output = Result<Self::Authenticated, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn assume_identity<'life0, 'life1, 'async_trait>( &'life0 self, identity: IdentityReference<'life1> ) -> Pin<Box<dyn Future<Output = Result<Self::Authenticated, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
identity
. If successful, the returned instance will have
the merged permissions of the current authentication session and the
permissions from identity
.source§fn add_permission_group_to_user<'user, 'group, 'life0, 'async_trait, U, G>(
&'life0 self,
user: U,
permission_group: G
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
U: 'async_trait + Nameable<'user, u64> + Send + Sync,
G: 'async_trait + Nameable<'group, u64> + Send + Sync,
Self: 'async_trait,
'user: 'async_trait,
'group: 'async_trait,
'life0: 'async_trait,
fn add_permission_group_to_user<'user, 'group, 'life0, 'async_trait, U, G>( &'life0 self, user: U, permission_group: G ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where U: 'async_trait + Nameable<'user, u64> + Send + Sync, G: 'async_trait + Nameable<'group, u64> + Send + Sync, Self: 'async_trait, 'user: 'async_trait, 'group: 'async_trait, 'life0: 'async_trait,
source§fn remove_permission_group_from_user<'user, 'group, 'life0, 'async_trait, U, G>(
&'life0 self,
user: U,
permission_group: G
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
U: 'async_trait + Nameable<'user, u64> + Send + Sync,
G: 'async_trait + Nameable<'group, u64> + Send + Sync,
Self: 'async_trait,
'user: 'async_trait,
'group: 'async_trait,
'life0: 'async_trait,
fn remove_permission_group_from_user<'user, 'group, 'life0, 'async_trait, U, G>( &'life0 self, user: U, permission_group: G ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where U: 'async_trait + Nameable<'user, u64> + Send + Sync, G: 'async_trait + Nameable<'group, u64> + Send + Sync, Self: 'async_trait, 'user: 'async_trait, 'group: 'async_trait, 'life0: 'async_trait,
source§fn add_role_to_user<'user, 'group, 'life0, 'async_trait, U, G>(
&'life0 self,
user: U,
role: G
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
U: 'async_trait + Nameable<'user, u64> + Send + Sync,
G: 'async_trait + Nameable<'group, u64> + Send + Sync,
Self: 'async_trait,
'user: 'async_trait,
'group: 'async_trait,
'life0: 'async_trait,
fn add_role_to_user<'user, 'group, 'life0, 'async_trait, U, G>( &'life0 self, user: U, role: G ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where U: 'async_trait + Nameable<'user, u64> + Send + Sync, G: 'async_trait + Nameable<'group, u64> + Send + Sync, Self: 'async_trait, 'user: 'async_trait, 'group: 'async_trait, 'life0: 'async_trait,
source§fn remove_role_from_user<'user, 'group, 'life0, 'async_trait, U, G>(
&'life0 self,
user: U,
role: G
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
U: 'async_trait + Nameable<'user, u64> + Send + Sync,
G: 'async_trait + Nameable<'group, u64> + Send + Sync,
Self: 'async_trait,
'user: 'async_trait,
'group: 'async_trait,
'life0: 'async_trait,
fn remove_role_from_user<'user, 'group, 'life0, 'async_trait, U, G>( &'life0 self, user: U, role: G ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where U: 'async_trait + Nameable<'user, u64> + Send + Sync, G: 'async_trait + Nameable<'group, u64> + Send + Sync, Self: 'async_trait, 'user: 'async_trait, 'group: 'async_trait, 'life0: 'async_trait,
§fn create_database<'life0, 'life1, 'async_trait, DB>(
&'life0 self,
name: &'life1 str,
only_if_needed: bool
) -> Pin<Box<dyn Future<Output = Result<Self::Database, Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
'life1: 'async_trait,
DB: 'async_trait + Schema,
Self: 'async_trait,
fn create_database<'life0, 'life1, 'async_trait, DB>( &'life0 self, name: &'life1 str, only_if_needed: bool ) -> Pin<Box<dyn Future<Output = Result<Self::Database, Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, 'life1: 'async_trait, DB: 'async_trait + Schema, Self: 'async_trait,
§fn authenticate_with_token<'life0, 'life1, 'async_trait>(
&'life0 self,
id: u64,
token: &'life1 SensitiveString
) -> Pin<Box<dyn Future<Output = Result<<Self::Authenticated as AsyncStorageConnection>::Authenticated, Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn authenticate_with_token<'life0, 'life1, 'async_trait>( &'life0 self, id: u64, token: &'life1 SensitiveString ) -> Pin<Box<dyn Future<Output = Result<<Self::Authenticated as AsyncStorageConnection>::Authenticated, Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,
AuthenticationToken
. If
successful, the returned instance will have the permissions from
identity
.§fn authenticate_with_password<'name, 'life0, 'async_trait, User>(
&'life0 self,
user: User,
password: SensitiveString
) -> Pin<Box<dyn Future<Output = Result<Self::Authenticated, Error>> + Send + 'async_trait, Global>>where
'name: 'async_trait,
'life0: 'async_trait,
User: 'async_trait + Nameable<'name, u64> + Send,
Self: 'async_trait,
fn authenticate_with_password<'name, 'life0, 'async_trait, User>( &'life0 self, user: User, password: SensitiveString ) -> Pin<Box<dyn Future<Output = Result<Self::Authenticated, Error>> + Send + 'async_trait, Global>>where 'name: 'async_trait, 'life0: 'async_trait, User: 'async_trait + Nameable<'name, u64> + Send, Self: 'async_trait,
User
using a password. If
successful, the returned instance will have the permissions from
identity
.source§impl<B: Backend> Clone for CustomServer<B>
impl<B: Backend> Clone for CustomServer<B>
source§impl<B: Backend> Deref for CustomServer<B>
impl<B: Backend> Deref for CustomServer<B>
source§impl<'a, B: Backend> From<&'a CustomServer<B>> for Storage
impl<'a, B: Backend> From<&'a CustomServer<B>> for Storage
source§fn from(server: &'a CustomServer<B>) -> Self
fn from(server: &'a CustomServer<B>) -> Self
source§impl<B: Backend> From<CustomServer<B>> for Storage
impl<B: Backend> From<CustomServer<B>> for Storage
source§fn from(server: CustomServer<B>) -> Self
fn from(server: CustomServer<B>) -> Self
source§impl<B: Backend> HasSession for CustomServer<B>
impl<B: Backend> HasSession for CustomServer<B>
§fn allowed_to<'a, R, P>(&self, resource_name: R, action: &P) -> boolwhere
R: AsRef<[Identifier<'a>]>,
P: Action,
fn allowed_to<'a, R, P>(&self, resource_name: R, action: &P) -> boolwhere R: AsRef<[Identifier<'a>]>, P: Action,
action
is permitted against resource_name
.§fn check_permission<'a, R, P>(
&self,
resource_name: R,
action: &P
) -> Result<(), Error>where
R: AsRef<[Identifier<'a>]>,
P: Action,
fn check_permission<'a, R, P>( &self, resource_name: R, action: &P ) -> Result<(), Error>where R: AsRef<[Identifier<'a>]>, P: Action,
action
is permitted against resource_name
. If permission
is denied, returns a PermissionDenied
error.