Struct rust_ipfs::UninitializedIpfs
source · pub struct UninitializedIpfs<C: NetworkBehaviour<ToSwarm = Void> + Send> { /* private fields */ }
Expand description
Configured Ipfs which can only be started.
Implementations§
source§impl<C: NetworkBehaviour<ToSwarm = Void> + Send> UninitializedIpfs<C>
impl<C: NetworkBehaviour<ToSwarm = Void> + Send> UninitializedIpfs<C>
sourcepub fn empty() -> Self
👎Deprecated: UninitializedIpfs::empty will be removed in the future. Use UninitializedIpfs::new()
pub fn empty() -> Self
New uninitualized instance without any listener addresses
sourcepub fn with_opt(options: IpfsOptions) -> Self
👎Deprecated: UninitializedIpfs::with_opt will be removed in the future. Use UninitializedIpfs::new()
pub fn with_opt(options: IpfsOptions) -> Self
Configures a new UninitializedIpfs with from the given options and optionally a span.
If the span is not given, it is defaulted to tracing::trace_span!("ipfs")
.
The span is attached to all operations called on the later created Ipfs
along with all
operations done in the background task as well as tasks spawned by the underlying
libp2p::Swarm
.
sourcepub fn set_default_listener(self) -> Self
pub fn set_default_listener(self) -> Self
Set default listening unspecified ipv4 and ipv6 addresseses for tcp and udp/quic
sourcepub fn add_listening_addr(self, addr: Multiaddr) -> Self
pub fn add_listening_addr(self, addr: Multiaddr) -> Self
Adds a listening address
sourcepub fn add_listening_addrs(self, addrs: Vec<Multiaddr>) -> Self
pub fn add_listening_addrs(self, addrs: Vec<Multiaddr>) -> Self
Adds a listening addresses
sourcepub fn set_listening_addrs(self, addrs: Vec<Multiaddr>) -> Self
pub fn set_listening_addrs(self, addrs: Vec<Multiaddr>) -> Self
Set a list of listening addresses
sourcepub fn add_bootstrap(self, addr: Multiaddr) -> Self
pub fn add_bootstrap(self, addr: Multiaddr) -> Self
Adds a bootstrap node
sourcepub fn with_default(self) -> Self
pub fn with_default(self) -> Self
Load default behaviour for basic functionality
sourcepub fn with_kademlia(
self,
config: impl Into<Either<KadConfig, Config>>,
store: KadStoreConfig
) -> Self
pub fn with_kademlia( self, config: impl Into<Either<KadConfig, Config>>, store: KadStoreConfig ) -> Self
Enables kademlia
sourcepub fn with_bitswap(self, config: BitswapConfig) -> Self
pub fn with_bitswap(self, config: BitswapConfig) -> Self
Enables bitswap
sourcepub fn with_relay(self, with_dcutr: bool) -> Self
pub fn with_relay(self, with_dcutr: bool) -> Self
Enable relay client
sourcepub fn with_relay_server(self, config: RelayConfig) -> Self
pub fn with_relay_server(self, config: RelayConfig) -> Self
Enable relay server
sourcepub fn with_rendezvous_server(self) -> Self
pub fn with_rendezvous_server(self) -> Self
Enables rendezvous server
sourcepub fn with_rendezvous_client(self) -> Self
pub fn with_rendezvous_client(self) -> Self
Enables rendezvous client
sourcepub fn with_identify(self, config: IdentifyConfiguration) -> Self
pub fn with_identify(self, config: IdentifyConfiguration) -> Self
Enables identify
sourcepub fn with_pubsub(self, config: PubsubConfig) -> Self
pub fn with_pubsub(self, config: PubsubConfig) -> Self
Enables pubsub
sourcepub fn with_autonat(self) -> Self
pub fn with_autonat(self) -> Self
Enables autonat
sourcepub fn with_custom_behaviour(self, behaviour: C) -> Self
pub fn with_custom_behaviour(self, behaviour: C) -> Self
Set a custom behaviour
sourcepub fn set_temp_pin_duration(self, duration: Duration) -> Self
pub fn set_temp_pin_duration(self, duration: Duration) -> Self
Set a duration for which blocks are not removed due to the garbage collector Defaults: 2 mins
sourcepub fn set_transport_configuration(self, config: TransportConfig) -> Self
pub fn set_transport_configuration(self, config: TransportConfig) -> Self
Set transport configuration
sourcepub fn set_idle_connection_timeout(self, duration: u64) -> Self
pub fn set_idle_connection_timeout(self, duration: u64) -> Self
Set timeout for idle connections
sourcepub fn set_swarm_configuration(self, config: SwarmConfig) -> Self
pub fn set_swarm_configuration(self, config: SwarmConfig) -> Self
Set swarm configuration
sourcepub fn default_record_key_validator(self) -> Self
pub fn default_record_key_validator(self) -> Self
Set default record validator for IPFS
Note: This will override any keys set for ipns
prefix
pub fn set_record_prefix_validator( self, key: &str, callback: Arc<dyn Fn(&str) -> Result<Key> + Sync + Send> ) -> Self
sourcepub fn set_addrbook_configuration(self, config: AddressBookConfig) -> Self
pub fn set_addrbook_configuration(self, config: AddressBookConfig) -> Self
Set address book configuration
sourcepub fn set_provider(self, opt: RepoProvider) -> Self
pub fn set_provider(self, opt: RepoProvider) -> Self
Set RepoProvider option to provide blocks automatically
sourcepub fn set_keypair(self, keypair: &Keypair) -> Self
pub fn set_keypair(self, keypair: &Keypair) -> Self
Set keypair
sourcepub fn set_keystore(self, keystore: &Keystore) -> Self
pub fn set_keystore(self, keystore: &Keystore) -> Self
Set a keystore
sourcepub fn listen_as_external_addr(self) -> Self
pub fn listen_as_external_addr(self) -> Self
Automatically add any listened address as an external address
sourcepub fn with_custom_transport(
self,
transport: Box<dyn Fn(&Keypair, Option<Transport>) -> Result<Boxed<(PeerId, StreamMuxerBox)>> + Sync + Send + 'static>
) -> Self
pub fn with_custom_transport( self, transport: Box<dyn Fn(&Keypair, Option<Transport>) -> Result<Boxed<(PeerId, StreamMuxerBox)>> + Sync + Send + 'static> ) -> Self
Set a transport
sourcepub fn swarm_events<F>(self, func: F) -> Self
pub fn swarm_events<F>(self, func: F) -> Self
Handle libp2p swarm events