pub struct NewStoreOptions {Show 19 fields
pub event_bus: Option<EventBus>,
pub index: Option<IndexConstructor>,
pub access_controller: Option<Arc<dyn AccessController>>,
pub directory: String,
pub sort_fn: Option<SortFn>,
pub peer_id: PeerId,
pub pubsub: Option<Arc<dyn PubSubInterface<Error = GuardianError>>>,
pub direct_channel: Option<Arc<dyn DirectChannel<Error = GuardianError>>>,
pub message_marshaler: Option<Arc<dyn MessageMarshaler<Error = GuardianError>>>,
pub cache: Option<Arc<dyn Datastore>>,
pub cache_destroy: Option<Box<dyn FnOnce() -> Result<(), Box<dyn Error + Send + Sync + 'static>> + Send + Sync>>,
pub replication_concurrency: Option<u32>,
pub reference_count: Option<i32>,
pub max_history: Option<i32>,
pub replicate: Option<bool>,
pub span: Option<Span>,
pub tracer: Option<Arc<TracerWrapper>>,
pub close_func: Option<Box<dyn FnOnce() + Send>>,
pub store_specific_opts: Option<Box<dyn Any + Send + Sync>>,
}Expand description
Opções detalhadas para a criação de uma nova instância de Store. Esta struct é o ponto central de configuração para todas as funcionalidades avançadas de uma store, incluindo índices, cache, replicação e telemetria.
Fields§
§event_bus: Option<EventBus>Barramento de eventos para comunicação interna
index: Option<IndexConstructor>Construtor do índice personalizado para a store
access_controller: Option<Arc<dyn AccessController>>Controlador de acesso para permissões e autenticação
directory: StringDiretório base para armazenamento de dados
sort_fn: Option<SortFn>Função de ordenação personalizada para entradas do log
peer_id: PeerIdIdentificador único do peer na rede P2P
pubsub: Option<Arc<dyn PubSubInterface<Error = GuardianError>>>Interface PubSub para comunicação distribuída
direct_channel: Option<Arc<dyn DirectChannel<Error = GuardianError>>>Canal direto para comunicação peer-to-peer
message_marshaler: Option<Arc<dyn MessageMarshaler<Error = GuardianError>>>Marshaler para serialização de mensagens de rede
cache: Option<Arc<dyn Datastore>>Sistema de cache para otimização de acesso a dados
cache_destroy: Option<Box<dyn FnOnce() -> Result<(), Box<dyn Error + Send + Sync + 'static>> + Send + Sync>>Callback para destruição do cache (pode falhar)
replication_concurrency: Option<u32>Número de workers para replicação concorrente
reference_count: Option<i32>Contador de referências para garbage collection
max_history: Option<i32>Limite máximo de entradas no histórico
replicate: Option<bool>Habilita/desabilita replicação automática
span: Option<Span>Sistema de logging estruturado
tracer: Option<Arc<TracerWrapper>>Tracer para telemetria distribuída (OpenTelemetry)
close_func: Option<Box<dyn FnOnce() + Send>>Callback executado no fechamento da store
store_specific_opts: Option<Box<dyn Any + Send + Sync>>Opções específicas do tipo de store (extensibilidade) Permite que diferentes tipos de store tenham configurações customizadas
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NewStoreOptions
impl !RefUnwindSafe for NewStoreOptions
impl Send for NewStoreOptions
impl !Sync for NewStoreOptions
impl Unpin for NewStoreOptions
impl !UnwindSafe for NewStoreOptions
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
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>
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>
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