pub struct PartIntegrity {
pub layout: IntegrityLayout,
pub number: u32,
pub generation: Uuid,
pub size: u64,
pub stripes: u32,
pub root: [u8; 32],
}Expand description
One immutable UploadPart/PUT generation. A metadata-only copy retains this identity; overwriting even an identical part creates a new generation.
Fields§
§layout: IntegrityLayout§number: u32§generation: Uuid§size: u64§stripes: u32§root: [u8; 32]Implementations§
Source§impl PartIntegrity
impl PartIntegrity
pub fn new(layout: IntegrityLayout, number: usize) -> Result<Self>
pub fn validate(&self) -> Result<()>
pub fn file_name(&self) -> String
pub fn height(&self) -> u32
pub fn record_size(&self) -> usize
pub fn index_size(&self) -> Result<usize>
pub fn record_offset(&self, stripe: u32) -> Result<usize>
pub fn index_header(&self) -> [u8; 64]
pub fn shard_digest( &self, stripe: u32, coding_index: usize, payload: &[u8], ) -> Result<[u8; 32]>
pub fn leaf_digest(&self, stripe: u32, digests: &[u8]) -> Result<[u8; 32]>
pub fn padding_digest(&self, stripe: u32) -> [u8; 32]
pub fn root_digest(&self, tree_root: &[u8; 32]) -> [u8; 32]
pub fn verify_record(&self, stripe: u32, record: &[u8]) -> Result<()>
pub fn verify_shard( &self, stripe: u32, coding_index: usize, payload: &[u8], record: &[u8], ) -> Result<()>
Trait Implementations§
Source§impl Clone for PartIntegrity
impl Clone for PartIntegrity
Source§impl Debug for PartIntegrity
impl Debug for PartIntegrity
Source§impl<'de> Deserialize<'de> for PartIntegrity
impl<'de> Deserialize<'de> for PartIntegrity
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PartIntegrity
Source§impl Hash for PartIntegrity
impl Hash for PartIntegrity
Source§impl PartialEq for PartIntegrity
impl PartialEq for PartIntegrity
Source§impl Serialize for PartIntegrity
impl Serialize for PartIntegrity
impl StructuralPartialEq for PartIntegrity
Auto Trait Implementations§
impl Freeze for PartIntegrity
impl RefUnwindSafe for PartIntegrity
impl Send for PartIntegrity
impl Sync for PartIntegrity
impl Unpin for PartIntegrity
impl UnsafeUnpin for PartIntegrity
impl UnwindSafe for PartIntegrity
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