pub struct VolumeSet {Show 14 fields
pub v: u16,
pub set_id: ByteBuf,
pub archive_name: String,
pub archive_size: u64,
pub archive_b3: ByteBuf,
pub piece_size: u32,
pub data: u16,
pub parity: u16,
pub pieces: u32,
pub stripes: u32,
pub piece_hashes: Vec<ByteBuf>,
pub parity_hashes: Vec<ByteBuf>,
pub root: ByteBuf,
pub generator: String,
}Expand description
The descriptor stored (identically) in every volume of a set.
Fields§
§v: u16§set_id: ByteBuf§archive_name: String§archive_size: u64§archive_b3: ByteBufBLAKE3 of the whole archive file: join verifies the rebuilt file against it.
piece_size: u32§data: u16§parity: u16§pieces: u32Number of real data pieces (ceil(archive_size / piece_size)).
stripes: u32ceil(pieces / data).
piece_hashes: Vec<ByteBuf>§parity_hashes: Vec<ByteBuf>stripes * parity hashes, index stripe * parity + j.
root: ByteBufMerkle root over the data piece hashes.
generator: StringImplementations§
Source§impl VolumeSet
impl VolumeSet
pub fn total(&self) -> usize
pub fn is_parity(&self, index: usize) -> bool
Sourcepub fn volume_pieces(&self, index: usize) -> u64
pub fn volume_pieces(&self, index: usize) -> u64
Number of pieces stored on volume index.
pub fn payload_len(&self, index: usize) -> u64
Sourcepub fn volume_name(&self, index: usize) -> String
pub fn volume_name(&self, index: usize) -> String
File name of volume index (1-based in the name, data volumes first). The archive name
comes from the descriptor, which may have arrived from another machine: it is used only
when it is a safe single path component (no separators, colons, control characters,
reserved device names or trailing dots/spaces); otherwise the set id names the files.
pub fn validate(&self) -> Result<()>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for VolumeSet
impl<'de> Deserialize<'de> for VolumeSet
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
Auto Trait Implementations§
impl Freeze for VolumeSet
impl RefUnwindSafe for VolumeSet
impl Send for VolumeSet
impl Sync for VolumeSet
impl Unpin for VolumeSet
impl UnsafeUnpin for VolumeSet
impl UnwindSafe for VolumeSet
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more