pub struct ErasureInfo {
pub algorithm: String,
pub data_blocks: usize,
pub parity_blocks: usize,
pub block_size: usize,
pub index: usize,
pub distribution: Vec<usize>,
pub checksums: Vec<ChecksumInfo>,
}Fields§
§algorithm: String§data_blocks: usize§parity_blocks: usize§block_size: usize§index: usize§distribution: Vec<usize>§checksums: Vec<ChecksumInfo>Implementations§
Source§impl ErasureInfo
impl ErasureInfo
pub fn get_checksum_info(&self, part_number: usize) -> ChecksumInfo
Sourcepub fn shard_size(&self) -> usize
pub fn shard_size(&self) -> usize
Calculate the size of each shard.
Sourcepub fn shard_file_size(&self, total_length: i64) -> i64
pub fn shard_file_size(&self, total_length: i64) -> i64
Calculate the total erasure file size for a given original size.
Sourcepub fn equals(&self, other: &ErasureInfo) -> bool
pub fn equals(&self, other: &ErasureInfo) -> bool
Check if this ErasureInfo equals another ErasureInfo
Trait Implementations§
Source§impl Clone for ErasureInfo
impl Clone for ErasureInfo
Source§impl Debug for ErasureInfo
impl Debug for ErasureInfo
Source§impl Default for ErasureInfo
impl Default for ErasureInfo
Source§impl<'de> Deserialize<'de> for ErasureInfo
impl<'de> Deserialize<'de> for ErasureInfo
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
Source§impl From<MetaObjectV1Erasure> for ErasureInfo
impl From<MetaObjectV1Erasure> for ErasureInfo
Source§fn from(value: MetaObjectV1Erasure) -> Self
fn from(value: MetaObjectV1Erasure) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ErasureInfo
impl PartialEq for ErasureInfo
Source§impl Serialize for ErasureInfo
impl Serialize for ErasureInfo
impl StructuralPartialEq for ErasureInfo
Auto Trait Implementations§
impl Freeze for ErasureInfo
impl RefUnwindSafe for ErasureInfo
impl Send for ErasureInfo
impl Sync for ErasureInfo
impl Unpin for ErasureInfo
impl UnsafeUnpin for ErasureInfo
impl UnwindSafe for ErasureInfo
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