pub struct Builder {Show 16 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 report: DynReportFactory,
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,
pub blocks: DynBlocksFactory,
}Expand description
The general Kitsune2 builder. This contains both configuration and factory instances, allowing construction of runtime module instances.
Fields§
§config: ConfigThe module configuration to be used when building modules. This can be loaded from disk or modified before freezing the builder.
verifier: DynVerifierThe 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: DynKitsuneFactoryThe KitsuneFactory to be used for creating Kitsune module instances.
space: DynSpaceFactoryThe SpaceFactory to be used for creating Space instances.
peer_store: DynPeerStoreFactoryThe PeerStoreFactory to be used for creating PeerStore instances.
bootstrap: DynBootstrapFactoryThe BootstrapFactory to be used for creating Bootstrap instances for initial WAN discovery.
fetch: DynFetchFactoryThe FetchFactory to be used for creating Fetch instances.
report: DynReportFactoryThe ReportFactory to be used for creating the Report instance.
transport: DynTransportFactoryThe TransportFactory to be used for creating Transport instances.
op_store: DynOpStoreFactoryThe OpStoreFactory to be used for creating OpStore instances.
peer_meta_store: DynPeerMetaStoreFactoryThe PeerMetaStoreFactory to be used for creating PeerMetaStore instances.
gossip: DynGossipFactoryThe GossipFactory to be used for creating Gossip instances.
local_agent_store: Arc<dyn LocalAgentStoreFactory>The LocalAgentStoreFactory to be used for creating LocalAgentStore instances.
publish: DynPublishFactoryThe PublishFactory to be used for creating Publish instances
blocks: DynBlocksFactoryThe BlocksFactory to be used for creating Blocks 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 fn with_config_overrides(&self, overrides: Config) -> K2Result<Self>
pub fn with_config_overrides(&self, overrides: Config) -> K2Result<Self>
Merge in configuration overrides.
Merged config is validated before returning.
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.