pub struct StorageBuilder<const INIT: bool = false> { /* private fields */ }
Expand description
Used to construct a StorageManager
This builder contains multiple options which can be used to configure the location and type in which results are stored. To get an overview over all possible options, we refer to the module documentation.
use cellular_raza_core::storage::{StorageBuilder, StorageOption};
let storage_priority = StorageOption::default_priority();
let storage_builder = StorageBuilder::new()
.priority(storage_priority)
.location("./");
Implementations§
Source§impl<const INIT: bool> StorageBuilder<INIT>
impl<const INIT: bool> StorageBuilder<INIT>
Sourcepub fn priority(self, priority: impl IntoIterator<Item = StorageOption>) -> Self
pub fn priority(self, priority: impl IntoIterator<Item = StorageOption>) -> Self
Define the priority of StorageOption. See StorageOption::default_priority.
Sourcepub fn get_priority(&self) -> UniqueVec<StorageOption>
pub fn get_priority(&self) -> UniqueVec<StorageOption>
Get the current priority
Sourcepub fn suffix(self, suffix: impl Into<PathBuf>) -> Self
pub fn suffix(self, suffix: impl Into<PathBuf>) -> Self
Define a suffix which will be appended to the save path
Sourcepub fn get_suffix(&self) -> PathBuf
pub fn get_suffix(&self) -> PathBuf
Get the current suffix
Sourcepub fn add_date(self, add_date: bool) -> Self
pub fn add_date(self, add_date: bool) -> Self
Store results by their current date inside the specified folder path
Sourcepub fn get_add_date(&self) -> bool
pub fn get_add_date(&self) -> bool
Get information if the current date should be appended to the storage path
Source§impl StorageBuilder<false>
impl StorageBuilder<false>
Sourcepub fn new() -> Self
pub fn new() -> Self
Constructs a new StorageBuilder with default settings.
use cellular_raza_core::storage::StorageBuilder;
let storage_builder = StorageBuilder::new();
Sourcepub fn init(self) -> StorageBuilder<true>
pub fn init(self) -> StorageBuilder<true>
Initializes the StorageBuilder thus filling information about time.
Sourcepub fn init_with_date(self, date: &Path) -> StorageBuilder<true>
pub fn init_with_date(self, date: &Path) -> StorageBuilder<true>
Specify the time at which the results should be saved
Sourcepub fn location<P>(self, location: P) -> Self
pub fn location<P>(self, location: P) -> Self
Define a folder where to store results
Note that this functionality is only available as long as the StorageBuilder has not been initialized.
Sourcepub fn get_location(&self) -> PathBuf
pub fn get_location(&self) -> PathBuf
Get the current storage_location
Note that this functionality is only available as long as the StorageBuilder has not been initialized.
Source§impl StorageBuilder<true>
impl StorageBuilder<true>
Sourcepub fn get_full_path(&self) -> PathBuf
pub fn get_full_path(&self) -> PathBuf
Get the fully constructed path after the Builder has been initialized with the StorageBuilder::init function.
Sourcepub fn de_init(self) -> StorageBuilder<false>
pub fn de_init(self) -> StorageBuilder<false>
De-initializes the StorageBuilder, making it possible to edit it again.
Trait Implementations§
Source§impl<const INIT: bool> Clone for StorageBuilder<INIT>
impl<const INIT: bool> Clone for StorageBuilder<INIT>
Source§fn clone(&self) -> StorageBuilder<INIT>
fn clone(&self) -> StorageBuilder<INIT>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<const INIT: bool> Debug for StorageBuilder<INIT>
impl<const INIT: bool> Debug for StorageBuilder<INIT>
Source§impl<'de, const INIT: bool> Deserialize<'de> for StorageBuilder<INIT>
impl<'de, const INIT: bool> Deserialize<'de> for StorageBuilder<INIT>
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>,
Auto Trait Implementations§
impl<const INIT: bool> Freeze for StorageBuilder<INIT>
impl<const INIT: bool> RefUnwindSafe for StorageBuilder<INIT>
impl<const INIT: bool> Send for StorageBuilder<INIT>
impl<const INIT: bool> Sync for StorageBuilder<INIT>
impl<const INIT: bool> Unpin for StorageBuilder<INIT>
impl<const INIT: bool> UnwindSafe for StorageBuilder<INIT>
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
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>
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>
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