pub struct IpfsBuilder<C: NetworkBehaviour<ToSwarm = Infallible> + Send + Sync + 'static> { /* private fields */ }Expand description
Configured Ipfs which can only be started.
Implementations§
Source§impl<C: NetworkBehaviour<ToSwarm = Infallible> + Send + Sync + 'static> IpfsBuilder<C>
impl<C: NetworkBehaviour<ToSwarm = Infallible> + Send + Sync + 'static> IpfsBuilder<C>
Sourcepub fn with_keypair(keypair: impl IntoKeypair) -> Result<Self>
pub fn with_keypair(keypair: impl IntoKeypair) -> Result<Self>
New instance with an existing keypair
Sourcepub fn set_default_listener(self) -> Self
pub fn set_default_listener(self) -> Self
Set default listening unspecified ipv4 and ipv6 addresses for tcp and quic Note that this still requires for the transports to be enabled to be usable
Sourcepub fn add_listening_addr(self, addr: Multiaddr) -> Self
pub fn add_listening_addr(self, addr: Multiaddr) -> Self
Adds a listening address
Sourcepub fn set_connection_limits<F>(self, f: F) -> Self
pub fn set_connection_limits<F>(self, f: F) -> Self
Set a connection limit
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) -> Self
pub fn with_kademlia(self) -> Self
Enables kademlia
Sourcepub fn with_bitswap(self) -> Self
pub fn with_bitswap(self) -> 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
pub fn with_streams(self) -> Self
Sourcepub fn with_pubsub(self, config: PubsubConfig) -> Self
pub fn with_pubsub(self, config: PubsubConfig) -> Self
Enables pubsub
Sourcepub fn with_request_response(self, config: Vec<RequestResponseConfig>) -> Self
pub fn with_request_response(self, config: Vec<RequestResponseConfig>) -> Self
Enables request response. Note: At this time, this option will only support up to 10 request-response behaviours. with any additional being ignored. Additionally, any duplicated protocols that are provided will be ignored.
Sourcepub fn with_autonat(self) -> Self
pub fn with_autonat(self) -> Self
Enables autonat
Sourcepub fn with_custom_behaviour<F>(self, f: F) -> Self
pub fn with_custom_behaviour<F>(self, f: F) -> 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_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<F>(self, f: F) -> Self
pub fn set_swarm_configuration<F>(self, f: F) -> 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<F>(self, key: &str, callback: F) -> 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_repo(self, repo: &Repo<DefaultStorage>) -> Self
pub fn set_repo(self, repo: &Repo<DefaultStorage>) -> Self
Set block and data repo
Sourcepub fn set_keystore(self, keystore: &Keystore) -> Self
pub fn set_keystore(self, keystore: &Keystore) -> Self
Set a keystore
Sourcepub fn enable_quic(self) -> Self
pub fn enable_quic(self) -> Self
Enables quic transport
Sourcepub fn enable_quic_with_config<F>(self, f: F) -> Self
pub fn enable_quic_with_config<F>(self, f: F) -> Self
Enables quic transport with custom configuration
Sourcepub fn enable_tcp(self) -> Self
pub fn enable_tcp(self) -> Self
Enables tcp transport
Sourcepub fn enable_tcp_with_config<F>(self, f: F) -> Self
pub fn enable_tcp_with_config<F>(self, f: F) -> Self
Enables tcp transport with custom configuration
Sourcepub fn enable_websocket(self) -> Self
pub fn enable_websocket(self) -> Self
Enables websocket transport
Sourcepub fn enable_secure_websocket(self) -> Self
pub fn enable_secure_websocket(self) -> Self
Enables secure websocket transport
Sourcepub fn enable_secure_websocket_with_pem(
self,
keypair: String,
certs: Vec<String>,
) -> Self
pub fn enable_secure_websocket_with_pem( self, keypair: String, certs: Vec<String>, ) -> Self
Enables secure websocket transport
Sourcepub fn enable_secure_websocket_with_config<F>(self, f: F) -> Result<Self>
pub fn enable_secure_websocket_with_config<F>(self, f: F) -> Result<Self>
Enables secure websocket transport
Sourcepub fn enable_dns(self) -> Self
pub fn enable_dns(self) -> Self
Enables DNS
Sourcepub fn enable_dns_with_resolver(self, resolver: DnsResolver) -> Self
pub fn enable_dns_with_resolver(self, resolver: DnsResolver) -> Self
Enables DNS with a specific resolver
Sourcepub fn enable_memory_transport(self) -> Self
pub fn enable_memory_transport(self) -> Self
Enables memory transport
Sourcepub fn swarm_events<F>(self, func: F) -> Self
pub fn swarm_events<F>(self, func: F) -> Self
Handle libp2p swarm events
Trait Implementations§
Source§impl<C: NetworkBehaviour<ToSwarm = Infallible> + Send + Sync + 'static> Default for IpfsBuilder<C>
impl<C: NetworkBehaviour<ToSwarm = Infallible> + Send + Sync + 'static> Default for IpfsBuilder<C>
Auto Trait Implementations§
impl<C> !Freeze for IpfsBuilder<C>
impl<C> !RefUnwindSafe for IpfsBuilder<C>
impl<C> !Send for IpfsBuilder<C>
impl<C> !Sync for IpfsBuilder<C>
impl<C> Unpin for IpfsBuilder<C>where
C: Unpin,
impl<C> UnsafeUnpin for IpfsBuilder<C>where
C: UnsafeUnpin,
impl<C> !UnwindSafe for IpfsBuilder<C>
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> 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> 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