pub enum SingleDiskFarmInfo {
V0 {
id: FarmId,
genesis_root: BlockRoot,
public_key: Ed25519PublicKey,
pieces_in_sector: u16,
allocated_space: u64,
},
}Expand description
Important information about the contents of the SingleDiskFarm
Variants§
Implementations§
Source§impl SingleDiskFarmInfo
impl SingleDiskFarmInfo
Sourcepub fn new(
id: FarmId,
genesis_root: BlockRoot,
public_key: Ed25519PublicKey,
pieces_in_sector: u16,
allocated_space: u64,
) -> Self
pub fn new( id: FarmId, genesis_root: BlockRoot, public_key: Ed25519PublicKey, pieces_in_sector: u16, allocated_space: u64, ) -> Self
Create a new instance
Sourcepub fn load_from(directory: &Path) -> Result<Option<Self>>
pub fn load_from(directory: &Path) -> Result<Option<Self>>
Load SingleDiskFarm from path is supposed to be stored, None means no info file was
found, happens during first start.
Sourcepub fn store_to(
&self,
directory: &Path,
lock: bool,
) -> Result<Option<SingleDiskFarmInfoLock>>
pub fn store_to( &self, directory: &Path, lock: bool, ) -> Result<Option<SingleDiskFarmInfoLock>>
Store SingleDiskFarm info to path, so it can be loaded again upon restart.
Can optionally return a lock.
Sourcepub fn try_lock(directory: &Path) -> Result<SingleDiskFarmInfoLock>
pub fn try_lock(directory: &Path) -> Result<SingleDiskFarmInfoLock>
Try to acquire exclusive lock on the single disk farm info file, ensuring no concurrent edits by cooperating processes is done
Sourcepub fn genesis_root(&self) -> &BlockRoot
pub fn genesis_root(&self) -> &BlockRoot
Genesis hash of the chain used for farm creation
Sourcepub fn public_key(&self) -> &Ed25519PublicKey
pub fn public_key(&self) -> &Ed25519PublicKey
Public key of identity used for farm creation
Sourcepub fn pieces_in_sector(&self) -> u16
pub fn pieces_in_sector(&self) -> u16
How many pieces does one sector contain.
Sourcepub fn allocated_space(&self) -> u64
pub fn allocated_space(&self) -> u64
How much space in bytes is allocated for this farm
Trait Implementations§
Source§impl Clone for SingleDiskFarmInfo
impl Clone for SingleDiskFarmInfo
Source§fn clone(&self) -> SingleDiskFarmInfo
fn clone(&self) -> SingleDiskFarmInfo
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SingleDiskFarmInfo
impl Debug for SingleDiskFarmInfo
Source§impl<'de> Deserialize<'de> for SingleDiskFarmInfo
impl<'de> Deserialize<'de> for SingleDiskFarmInfo
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 Serialize for SingleDiskFarmInfo
impl Serialize for SingleDiskFarmInfo
impl Copy for SingleDiskFarmInfo
Auto Trait Implementations§
impl Freeze for SingleDiskFarmInfo
impl RefUnwindSafe for SingleDiskFarmInfo
impl Send for SingleDiskFarmInfo
impl Sync for SingleDiskFarmInfo
impl Unpin for SingleDiskFarmInfo
impl UnwindSafe for SingleDiskFarmInfo
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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