[−][src]Struct bandsocks::ContentDigest
A digest securely identifies the specific contents of a binary object
Digests include the hash format, which is currently always sha256
Implementations
impl ContentDigest
[src]
pub fn as_str(&self) -> &str
[src]
Returns a reference to the existing string representation of a ContentDigest
This string always has a single colon. After the colon is 32 or more characters which will always be lowercase hexadecimal digits. The format specifier before this colon is alphanumeric, with plus, dash, underscore, or dot characters allowed as separators between valid groups of alphanumeric characters.
pub fn from_parts<T: LowerHex>(
format_part: &str,
hex_part: &T
) -> Result<Self, ImageError>
[src]
format_part: &str,
hex_part: &T
) -> Result<Self, ImageError>
Create a new ContentDigest from parts
The format string and hex string are assembled and parsed.
pub fn from_content(content_bytes: &[u8]) -> Self
[src]
Create a new ContentDigest from content data
This hashes the content using the the sha256
algorithm.
let digest = ContentDigest::from_content(b"cat"); assert_eq!(digest.as_str(), "sha256:77af778b51abd4a3c51c5ddd97204a9c3ae614ebccb75a606c3b6865aed6744e");
pub fn parse(s: &str) -> Result<Self, ImageError>
[src]
Parse a str as a ContentDigest
let digest = ContentDigest::parse("format:00112233445566778899aabbccddeeff").unwrap(); assert_eq!(digest.format_str(), "format"); assert_eq!(digest.hex_str(), "00112233445566778899aabbccddeeff")
pub fn format_str(&self) -> &str
[src]
Return a reference to the format string portion of this digest.
Currently this is sha256
for all digests we create or recognize.
pub fn hex_str(&self) -> &str
[src]
Return a reference to the hexadecimal string portion of this digest.
This is guaranteed to be a string of at least 32 hex digits.
Trait Implementations
impl Clone for ContentDigest
[src]
pub fn clone(&self) -> ContentDigest
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ContentDigest
[src]
impl Display for ContentDigest
[src]
impl Eq for ContentDigest
[src]
impl FromStr for ContentDigest
[src]
type Err = ImageError
The associated error which can be returned from parsing.
pub fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl Hash for ContentDigest
[src]
pub fn hash<H: Hasher>(&self, state: &mut H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for ContentDigest
[src]
pub fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<ContentDigest> for ContentDigest
[src]
pub fn eq(&self, other: &Self) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<ContentDigest> for ContentDigest
[src]
Auto Trait Implementations
impl RefUnwindSafe for ContentDigest
impl Send for ContentDigest
impl Sync for ContentDigest
impl Unpin for ContentDigest
impl UnwindSafe for ContentDigest
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,