pub struct IpfsAccessController { /* private fields */ }Expand description
Estrutura principal do controlador de acesso IPFS.
Implementations§
Source§impl IpfsAccessController
impl IpfsAccessController
pub fn get_type(&self) -> &'static str
Sourcepub fn address(&self) -> Option<Box<dyn Address>>
pub fn address(&self) -> Option<Box<dyn Address>>
Este controlador não tem um endereço próprio, então retorna None.
pub async fn can_append( &self, entry: &dyn LogEntry, identity_provider: &dyn IdentityProvider, _additional_context: &dyn CanAppendAdditionalContext, ) -> Result<()>
pub async fn grant(&self, capability: &str, key_id: &str) -> Result<()>
pub async fn revoke(&self, capability: &str, key_id: &str) -> Result<()>
pub async fn load(&self, address: &str) -> Result<()>
pub async fn save(&self) -> Result<CreateAccessControllerOptions>
pub async fn close(&self) -> Result<()>
pub fn new( ipfs_client: Arc<IpfsClient>, identity_id: String, params: CreateAccessControllerOptions, ) -> Result<Self>
Trait Implementations§
Source§impl AccessController for IpfsAccessController
impl AccessController for IpfsAccessController
Retorna a lista de chaves autorizadas para uma dada permissão (“role”).
Source§fn grant<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
capability: &'life1 str,
key_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn grant<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
capability: &'life1 str,
key_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Concede a uma nova chave uma determinada permissão.
Source§fn revoke<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
capability: &'life1 str,
key_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn revoke<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
capability: &'life1 str,
key_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Remove a permissão de uma chave para realizar uma ação.
Source§fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Carrega a configuração do controlador de acesso a partir de um endereço.
Source§fn save<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn ManifestParams>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn save<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn ManifestParams>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Salva/persiste a configuração do controlador (seu manifesto).
Source§fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fecha o controlador e libera quaisquer recursos.
Source§fn can_append<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
entry: &'life1 dyn LogEntry,
_identity_provider: &'life2 dyn IdentityProvider,
_additional_context: &'life3 dyn CanAppendAdditionalContext,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn can_append<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
entry: &'life1 dyn LogEntry,
_identity_provider: &'life2 dyn IdentityProvider,
_additional_context: &'life3 dyn CanAppendAdditionalContext,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Verifica se uma entrada pode ser adicionada ao log.
Auto Trait Implementations§
impl !Freeze for IpfsAccessController
impl !RefUnwindSafe for IpfsAccessController
impl Send for IpfsAccessController
impl Sync for IpfsAccessController
impl Unpin for IpfsAccessController
impl !UnwindSafe for IpfsAccessController
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> 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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more