Trait ipfs_api_prelude::TryFromUri [−][src]
pub trait TryFromUri: Sized {
fn build_with_base_uri(uri: Uri) -> Self;
fn from_str(uri: &str) -> Result<Self, InvalidUri> { ... }
fn from_host_and_port(
scheme: Scheme,
host: &str,
port: u16
) -> Result<Self, Error> { ... }
fn from_ipv4(scheme: Scheme, addr: SocketAddrV4) -> Result<Self, Error> { ... }
fn from_ipv6(scheme: Scheme, addr: SocketAddrV6) -> Result<Self, Error> { ... }
fn from_socket(
scheme: Scheme,
socket_addr: SocketAddr
) -> Result<Self, Error> { ... }
fn from_multiaddr(multiaddr: Multiaddr) -> Result<Self, Error> { ... }
fn from_multiaddr_str(multiaddr: &str) -> Result<Self, Error> { ... }
fn from_ipfs_config() -> Option<Self> { ... }
}
Required methods
fn build_with_base_uri(uri: Uri) -> Self
fn build_with_base_uri(uri: Uri) -> Self
Builds a new client from a base URI to the IPFS API.
Provided methods
fn from_str(uri: &str) -> Result<Self, InvalidUri>
fn from_str(uri: &str) -> Result<Self, InvalidUri>
Creates a new client from a str.
Note: This constructor will overwrite the path/query part of the URI.
Creates a new client from a host name and port.
Creates a new client from an IPV4 address and port number.
Creates a new client from an IPV6 addr and port number.
fn from_socket(scheme: Scheme, socket_addr: SocketAddr) -> Result<Self, Error>
fn from_socket(scheme: Scheme, socket_addr: SocketAddr) -> Result<Self, Error>
Creates a new client from an IP address and port number.
fn from_multiaddr(multiaddr: Multiaddr) -> Result<Self, Error>
fn from_multiaddr(multiaddr: Multiaddr) -> Result<Self, Error>
Creates a new client from a multiaddr.
fn from_multiaddr_str(multiaddr: &str) -> Result<Self, Error>
fn from_multiaddr_str(multiaddr: &str) -> Result<Self, Error>
Creates a new client from a multiaddr.
fn from_ipfs_config() -> Option<Self>
fn from_ipfs_config() -> Option<Self>
Creates a new client connected to the endpoint specified in ~/.ipfs/api.