Struct StorageBuilder
pub struct StorageBuilder<const INIT: bool = false> { /* private fields */ }cpu_os_threads only.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§
§impl<const INIT: bool> StorageBuilder<INIT>
impl<const INIT: bool> StorageBuilder<INIT>
pub fn priority(
self,
priority: impl IntoIterator<Item = StorageOption>,
) -> StorageBuilder<INIT>
pub fn priority( self, priority: impl IntoIterator<Item = StorageOption>, ) -> StorageBuilder<INIT>
Define the priority of StorageOption. See StorageOption::default_priority.
pub fn get_priority(&self) -> UniqueVec<StorageOption>
pub fn get_priority(&self) -> UniqueVec<StorageOption>
Get the current priority
pub fn suffix(self, suffix: impl Into<PathBuf>) -> StorageBuilder<INIT>
pub fn suffix(self, suffix: impl Into<PathBuf>) -> StorageBuilder<INIT>
Define a suffix which will be appended to the save path
pub fn get_suffix(&self) -> PathBuf
pub fn get_suffix(&self) -> PathBuf
Get the current suffix
pub fn add_date(self, add_date: bool) -> StorageBuilder<INIT>
pub fn add_date(self, add_date: bool) -> StorageBuilder<INIT>
Store results by their current date inside the specified folder path
pub 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
§impl StorageBuilder
impl StorageBuilder
pub fn new() -> StorageBuilder
pub fn new() -> StorageBuilder
Constructs a new StorageBuilder with default settings.
use cellular_raza_core::storage::StorageBuilder;
let storage_builder = StorageBuilder::new();pub fn init(self) -> StorageBuilder<true>
pub fn init(self) -> StorageBuilder<true>
Initializes the StorageBuilder thus filling information about time.
pub 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
pub fn location<P>(self, location: P) -> StorageBuilder
pub fn location<P>(self, location: P) -> StorageBuilder
Define a folder where to store results
Note that this functionality is only available as long as the StorageBuilder has not been initialized.
pub 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.
§impl StorageBuilder<true>
impl StorageBuilder<true>
pub 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.
pub fn de_init(self) -> StorageBuilder
pub fn de_init(self) -> StorageBuilder
De-initializes the StorageBuilder, making it possible to edit it again.
Trait Implementations§
§impl<const INIT: bool> Clone for StorageBuilder<INIT>
impl<const INIT: bool> Clone for StorageBuilder<INIT>
§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 more§impl<const INIT: bool> Debug for StorageBuilder<INIT>
impl<const INIT: bool> Debug for StorageBuilder<INIT>
§impl<'de, const INIT: bool> Deserialize<'de> for StorageBuilder<INIT>
impl<'de, const INIT: bool> Deserialize<'de> for StorageBuilder<INIT>
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<StorageBuilder<INIT>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<StorageBuilder<INIT>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl<const INIT: bool> Serialize for StorageBuilder<INIT>
impl<const INIT: bool> Serialize for StorageBuilder<INIT>
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.