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 with_opt(options: IpfsOptions) -> Self
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 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 set_identify_configuration(self, config: IdentifyConfiguration) -> Self
pub fn set_identify_configuration(self, config: IdentifyConfiguration) -> Self
Set identify configuration
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 set_kad_configuration(
self,
config: KadConfig,
store: KadStoreConfig
) -> Self
pub fn set_kad_configuration( self, config: KadConfig, store: KadStoreConfig ) -> Self
Set kad configuration
sourcepub fn set_ping_configuration(self, config: PingConfig) -> Self
pub fn set_ping_configuration(self, config: PingConfig) -> Self
Set ping 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_pubsub_configuration(self, config: PubsubConfig) -> Self
pub fn set_pubsub_configuration(self, config: PubsubConfig) -> Self
Set pubsub 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 enable_keepalive(self) -> Self
👎Deprecated: use UninitializedIpfs::set_idle_connection(u64::MAX / 2)
pub fn enable_keepalive(self) -> Self
Enable keep alive
sourcepub fn disable_kad(self) -> Self
pub fn disable_kad(self) -> Self
Disables kademlia
sourcepub fn disable_bitswap(self) -> Self
pub fn disable_bitswap(self) -> Self
Disable bitswap
sourcepub fn set_bitswap_configuration(self, config: BitswapConfig) -> Self
pub fn set_bitswap_configuration(self, config: BitswapConfig) -> Self
Set Bitswap configuration
sourcepub fn set_keystore(self, keystore: Keystore) -> Self
pub fn set_keystore(self, keystore: Keystore) -> Self
Set a keystore
sourcepub fn enable_mdns(self) -> Self
pub fn enable_mdns(self) -> Self
Enable mdns
sourcepub fn enable_relay(self, with_dcutr: bool) -> Self
pub fn enable_relay(self, with_dcutr: bool) -> Self
Enable relay client
sourcepub fn enable_relay_server(self, config: Option<RelayConfig>) -> Self
pub fn enable_relay_server(self, config: Option<RelayConfig>) -> Self
Enable relay server
sourcepub fn enable_upnp(self) -> Self
pub fn enable_upnp(self) -> Self
Enable port mapping (AKA UPnP)
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
pub fn enable_rendezvous_server(self) -> Self
pub fn enable_rendezvous_client(self) -> Self
sourcepub fn set_custom_behaviour(self, behaviour: C) -> Self
pub fn set_custom_behaviour(self, behaviour: C) -> Self
Set a custom behaviour
sourcepub fn set_custom_transport(
self,
transport: Box<dyn Fn(&Keypair, Option<Transport>) -> Result<Boxed<(PeerId, StreamMuxerBox)>> + Sync + Send + 'static>
) -> Self
pub fn set_custom_transport( self, transport: Box<dyn Fn(&Keypair, Option<Transport>) -> Result<Boxed<(PeerId, StreamMuxerBox)>> + Sync + Send + 'static> ) -> Self
Set a transport
sourcepub fn disable_delay(self) -> Self
pub fn disable_delay(self) -> Self
Used to delay the loop Note: This may be removed in future