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§fn clone(&self) -> ErasureInfo
fn clone(&self) -> ErasureInfo
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ErasureInfo
impl Debug for ErasureInfo
Source§impl Default for ErasureInfo
impl Default for ErasureInfo
Source§fn default() -> ErasureInfo
fn default() -> ErasureInfo
Returns the “default value” for a type. Read more
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 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 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