[−][src]Struct asuran_core::repository::chunk::ChunkID
Key used for indexing a Chunk in a repository
These are usually derived via an HMAC of the chunks plain text, and are used for
reduplication. If two chunks have the same ChunkID, it is assumed that they
are identical.
Implementations
impl ChunkID[src]
pub fn new(input_id: &[u8]) -> ChunkID[src]
Will create a new key from a slice.
Keys longer than 32 bytes will be truncated. Keys shorter than 32 bytes will be padded at the end with zeros.
pub fn get_id(&self) -> &[u8][src]
Provides a reference to a key's raw bytes
pub fn verify(&self, slice: &[u8]) -> bool[src]
Verifies equaliy of this key with the first 32 bytes of a slice
pub fn manifest_id() -> ChunkID[src]
Returns the special all-zero key used for the manifest
pub fn random_id() -> ChunkID[src]
Returns a random id, used for testing
Trait Implementations
impl Clone for ChunkID[src]
impl Copy for ChunkID[src]
impl Debug for ChunkID[src]
impl<'de> Deserialize<'de> for ChunkID[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
__D: Deserializer<'de>,
impl Eq for ChunkID[src]
impl Hash for ChunkID[src]
fn hash<__H: Hasher>(&self, state: &mut __H)[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl PartialEq<ChunkID> for ChunkID[src]
impl Serialize for ChunkID[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer, [src]
__S: Serializer,
impl StructuralEq for ChunkID[src]
impl StructuralPartialEq for ChunkID[src]
Auto Trait Implementations
impl RefUnwindSafe for ChunkID
impl Send for ChunkID
impl Sync for ChunkID
impl Unpin for ChunkID
impl UnwindSafe for ChunkID
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,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T[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.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
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.
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.
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>,