pub struct Builder {Show 14 fields
pub config: Config,
pub verifier: DynVerifier,
pub auth_material: Option<Vec<u8>>,
pub kitsune: DynKitsuneFactory,
pub space: DynSpaceFactory,
pub peer_store: DynPeerStoreFactory,
pub bootstrap: DynBootstrapFactory,
pub fetch: DynFetchFactory,
pub transport: DynTransportFactory,
pub op_store: DynOpStoreFactory,
pub peer_meta_store: DynPeerMetaStoreFactory,
pub gossip: DynGossipFactory,
pub local_agent_store: Arc<dyn LocalAgentStoreFactory>,
pub publish: DynPublishFactory,
}
Expand description
The general Kitsune2 builder. This contains both configuration and factory instances, allowing construction of runtime module instances.
Fields§
§config: Config
The module configuration to be used when building modules. This can be loaded from disk or modified before freezing the builder.
verifier: DynVerifier
The Verifier to use for this Kitsune2 instance.
auth_material: Option<Vec<u8>>
Any auth_material required to connect to sbd/signal and bootstrap services.
kitsune: DynKitsuneFactory
The KitsuneFactory to be used for creating Kitsune module instances.
space: DynSpaceFactory
The SpaceFactory to be used for creating Space instances.
peer_store: DynPeerStoreFactory
The PeerStoreFactory to be used for creating PeerStore instances.
bootstrap: DynBootstrapFactory
The BootstrapFactory to be used for creating Bootstrap instances for initial WAN discovery.
fetch: DynFetchFactory
The FetchFactory to be used for creating Fetch instances.
transport: DynTransportFactory
The TransportFactory to be used for creating Transport instances.
op_store: DynOpStoreFactory
The OpStoreFactory to be used for creating OpStore instances.
peer_meta_store: DynPeerMetaStoreFactory
The PeerMetaStoreFactory to be used for creating PeerMetaStore instances.
gossip: DynGossipFactory
The GossipFactory to be used for creating Gossip instances.
local_agent_store: Arc<dyn LocalAgentStoreFactory>
The LocalAgentStoreFactory to be used for creating LocalAgentStore instances.
publish: DynPublishFactory
The PublishFactory to be used for creating Publish instances
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn with_default_config(self) -> K2Result<Self>
pub fn with_default_config(self) -> K2Result<Self>
Construct a default config given the configured module factories.
Note, this should be called before Self::build or otherwise freezing the Builder instance in an Arc<>.
Sourcepub fn validate_config(&self) -> K2Result<()>
pub fn validate_config(&self) -> K2Result<()>
Validate the current configuration.
Sourcepub async fn build(self) -> K2Result<DynKitsune>
pub async fn build(self) -> K2Result<DynKitsune>
Generate the actual kitsune instance, validating configuration if that has not already explicitly been done.