pub struct IpfsFetchPolicy { /* private fields */ }Expand description
Fetch policy for IPFS reads.
Implementations§
Source§impl IpfsFetchPolicy
impl IpfsFetchPolicy
Sourcepub fn new(read_base_uri: impl Into<String>) -> Result<Self, AppDataError>
pub fn new(read_base_uri: impl Into<String>) -> Result<Self, AppDataError>
Creates a fetch policy with an explicit read base URI.
§Errors
Returns AppDataError::Transport if the URI is empty after trimming.
Sourcepub fn from_config(config: &IpfsConfig) -> Result<Self, AppDataError>
pub fn from_config(config: &IpfsConfig) -> Result<Self, AppDataError>
Creates a fetch policy from IpfsConfig.
read_uri takes precedence over the general uri field.
§Errors
Returns AppDataError::Transport if the resolved URI is empty after trimming.
Sourcepub fn read_base_uri(&self) -> &str
pub fn read_base_uri(&self) -> &str
Returns the normalized IPFS read base URI.
Sourcepub fn with_read_base_uri(
self,
read_base_uri: impl Into<String>,
) -> Result<Self, AppDataError>
pub fn with_read_base_uri( self, read_base_uri: impl Into<String>, ) -> Result<Self, AppDataError>
Returns a copy of this policy with a new read base URI.
§Errors
Returns AppDataError::Transport if the URI is empty after trimming.
Trait Implementations§
Source§impl Clone for IpfsFetchPolicy
impl Clone for IpfsFetchPolicy
Source§fn clone(&self) -> IpfsFetchPolicy
fn clone(&self) -> IpfsFetchPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IpfsFetchPolicy
impl Debug for IpfsFetchPolicy
Source§impl Default for IpfsFetchPolicy
impl Default for IpfsFetchPolicy
impl Eq for IpfsFetchPolicy
Source§impl PartialEq for IpfsFetchPolicy
impl PartialEq for IpfsFetchPolicy
Source§fn eq(&self, other: &IpfsFetchPolicy) -> bool
fn eq(&self, other: &IpfsFetchPolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for IpfsFetchPolicy
Auto Trait Implementations§
impl Freeze for IpfsFetchPolicy
impl RefUnwindSafe for IpfsFetchPolicy
impl Send for IpfsFetchPolicy
impl Sync for IpfsFetchPolicy
impl Unpin for IpfsFetchPolicy
impl UnsafeUnpin for IpfsFetchPolicy
impl UnwindSafe for IpfsFetchPolicy
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.