BaseGuardianDB

Trait BaseGuardianDB 

Source
pub trait BaseGuardianDB: Send + Sync {
    type Error: Error + Send + Sync + 'static;

Show 14 methods // Required methods fn ipfs(&self) -> Arc<IpfsClient>; fn identity(&self) -> Arc<Identity>; fn open<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, address: &'life1 str, options: &'life2 mut CreateDBOptions, ) -> Pin<Box<dyn Future<Output = Result<Arc<dyn Store<Error = GuardianError>>, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn get_store( &self, address: &str, ) -> Option<Arc<dyn Store<Error = GuardianError>>>; fn create<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, name: &'life1 str, store_type: &'life2 str, options: &'life3 mut CreateDBOptions, ) -> Pin<Box<dyn Future<Output = Result<Arc<dyn Store<Error = GuardianError>>, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; fn determine_address<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, name: &'life1 str, store_type: &'life2 str, options: &'life3 DetermineAddressOptions, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Address>, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; fn register_store_type( &mut self, store_type: &str, constructor: StoreConstructor, ); fn unregister_store_type(&mut self, store_type: &str); fn register_access_controller_type( &mut self, constructor: AccessControllerConstructor, ) -> Result<(), Self::Error>; fn unregister_access_controller_type(&mut self, controller_type: &str); fn get_access_controller_type( &self, controller_type: &str, ) -> Option<AccessControllerConstructor>; fn event_bus(&self) -> EventBus; fn span(&self) -> &Span; fn tracer(&self) -> Arc<TracerWrapper>;
}

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

Define um tipo de erro associado para flexibilidade na implementação.

Required Methods§

Source

fn ipfs(&self) -> Arc<IpfsClient>

Retorna a instância da API do IPFS.

Source

fn identity(&self) -> Arc<Identity>

Retorna a identidade utilizada pelo GuardianDB.

Source

fn open<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, address: &'life1 str, options: &'life2 mut CreateDBOptions, ) -> Pin<Box<dyn Future<Output = Result<Arc<dyn Store<Error = GuardianError>>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Cria ou abre uma store com o endereço e opções fornecidos.

Source

fn get_store( &self, address: &str, ) -> Option<Arc<dyn Store<Error = GuardianError>>>

Retorna uma instância da store se ela já estiver aberta.

Source

fn create<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, name: &'life1 str, store_type: &'life2 str, options: &'life3 mut CreateDBOptions, ) -> Pin<Box<dyn Future<Output = Result<Arc<dyn Store<Error = GuardianError>>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Cria uma nova store com o nome, tipo e opções fornecidos.

Source

fn determine_address<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, name: &'life1 str, store_type: &'life2 str, options: &'life3 DetermineAddressOptions, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Address>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Determina o endereço de um banco de dados com base nos seus parâmetros.

Source

fn register_store_type( &mut self, store_type: &str, constructor: StoreConstructor, )

Registra um novo tipo de Store.

Source

fn unregister_store_type(&mut self, store_type: &str)

Desregistra um tipo de Store.

Source

fn register_access_controller_type( &mut self, constructor: AccessControllerConstructor, ) -> Result<(), Self::Error>

Registra um novo tipo de Access Controller.

Source

fn unregister_access_controller_type(&mut self, controller_type: &str)

Desregistra um tipo de Access Controller.

Source

fn get_access_controller_type( &self, controller_type: &str, ) -> Option<AccessControllerConstructor>

Obtém um construtor de Access Controller pelo seu tipo.

Source

fn event_bus(&self) -> EventBus

Retorna o barramento de eventos.

Source

fn span(&self) -> &Span

Retorna o span para tracing.

Source

fn tracer(&self) -> Arc<TracerWrapper>

Retorna o tracer para telemetria.

Implementors§

Source§

impl BaseGuardianDB for guardian_db::base_guardian::GuardianDB

Implementação da trait BaseGuardianDB para GuardianDB

Source§

impl BaseGuardianDB for guardian_db::guardian::GuardianDB