Struct iroh_blobs::HashAndFormat
pub struct HashAndFormat {
pub hash: Hash,
pub format: BlobFormat,
}
Expand description
A hash and format pair
Fields§
§hash: Hash
The hash
format: BlobFormat
The format
Implementations§
§impl HashAndFormat
impl HashAndFormat
pub fn new(hash: Hash, format: BlobFormat) -> HashAndFormat
pub fn new(hash: Hash, format: BlobFormat) -> HashAndFormat
Create a new hash and format pair.
pub fn raw(hash: Hash) -> HashAndFormat
pub fn raw(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the default (raw) format.
pub fn hash_seq(hash: Hash) -> HashAndFormat
pub fn hash_seq(hash: Hash) -> HashAndFormat
Create a new hash and format pair, using the collection format.
Trait Implementations§
§impl Clone for HashAndFormat
impl Clone for HashAndFormat
§fn clone(&self) -> HashAndFormat
fn clone(&self) -> HashAndFormat
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for HashAndFormat
impl Debug for HashAndFormat
§impl<'de> Deserialize<'de> for HashAndFormat
impl<'de> Deserialize<'de> for HashAndFormat
§fn deserialize<D>(
deserializer: D
) -> Result<HashAndFormat, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<HashAndFormat, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Display for HashAndFormat
impl Display for HashAndFormat
source§impl From<DownloadKind> for HashAndFormat
Available on crate feature downloader
only.
impl From<DownloadKind> for HashAndFormat
Available on crate feature
downloader
only.source§fn from(value: DownloadKind) -> Self
fn from(value: DownloadKind) -> Self
Converts to this type from the input type.
source§impl From<HashAndFormat> for DownloadKind
Available on crate feature downloader
only.
impl From<HashAndFormat> for DownloadKind
Available on crate feature
downloader
only.source§fn from(value: HashAndFormat) -> Self
fn from(value: HashAndFormat) -> Self
Converts to this type from the input type.
§impl FromStr for HashAndFormat
impl FromStr for HashAndFormat
§impl Hash for HashAndFormat
impl Hash for HashAndFormat
§impl MaxSize for HashAndFormat
impl MaxSize for HashAndFormat
§const POSTCARD_MAX_SIZE: usize = 33usize
const POSTCARD_MAX_SIZE: usize = 33usize
The maximum possible size that the serialization of this
type can have, in bytes.
§impl Ord for HashAndFormat
impl Ord for HashAndFormat
§impl PartialEq for HashAndFormat
impl PartialEq for HashAndFormat
§fn eq(&self, other: &HashAndFormat) -> bool
fn eq(&self, other: &HashAndFormat) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.§impl PartialOrd for HashAndFormat
impl PartialOrd for HashAndFormat
§fn partial_cmp(&self, other: &HashAndFormat) -> Option<Ordering>
fn partial_cmp(&self, other: &HashAndFormat) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more§impl Serialize for HashAndFormat
impl Serialize for HashAndFormat
§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
§impl Value for HashAndFormat
impl Value for HashAndFormat
§type SelfType<'a> = HashAndFormat
type SelfType<'a> = HashAndFormat
SelfType<’a> must be the same type as Self with all lifetimes replaced with ’a
type AsBytes<'a> = [u8; 33]
§fn fixed_width() -> Option<usize>
fn fixed_width() -> Option<usize>
Width of a fixed type, or None for variable width
§fn from_bytes<'a>(data: &'a [u8]) -> <HashAndFormat as Value>::SelfType<'a>where
HashAndFormat: 'a,
fn from_bytes<'a>(data: &'a [u8]) -> <HashAndFormat as Value>::SelfType<'a>where
HashAndFormat: 'a,
Deserializes data
Implementations may return a view over data, or an owned type
§fn as_bytes<'a, 'b>(
value: &'a <HashAndFormat as Value>::SelfType<'b>
) -> <HashAndFormat as Value>::AsBytes<'a>where
'b: 'a,
HashAndFormat: 'a + 'b,
fn as_bytes<'a, 'b>(
value: &'a <HashAndFormat as Value>::SelfType<'b>
) -> <HashAndFormat as Value>::AsBytes<'a>where
'b: 'a,
HashAndFormat: 'a + 'b,
Serialize the value to a slice
impl Copy for HashAndFormat
impl Eq for HashAndFormat
impl StructuralPartialEq for HashAndFormat
Auto Trait Implementations§
impl Freeze for HashAndFormat
impl RefUnwindSafe for HashAndFormat
impl Send for HashAndFormat
impl Sync for HashAndFormat
impl Unpin for HashAndFormat
impl UnwindSafe for HashAndFormat
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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
Mutably borrows from an owned value. Read more
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.