Struct versatile_data::Data
source · pub struct Data { /* private fields */ }Implementations§
source§impl Data
impl Data
sourcepub fn result_condition<'life0, 'life_self, 'async_recursion>(
&'life_self self,
condition: &'life0 Condition<'_>
) -> Pin<Box<dyn Future<Output = RowSet> + 'async_recursion>>where
'life0: 'async_recursion,
'life_self: 'async_recursion,
pub fn result_condition<'life0, 'life_self, 'async_recursion>(
&'life_self self,
condition: &'life0 Condition<'_>
) -> Pin<Box<dyn Future<Output = RowSet> + 'async_recursion>>where
'life0: 'async_recursion,
'life_self: 'async_recursion,
Returns search results by specifying Condition.
pub fn result_field(&self, field_name: &str, condition: &Field) -> RowSet
source§impl Data
impl Data
sourcepub fn begin_search(&self) -> Search<'_>
pub fn begin_search(&self) -> Search<'_>
Create a new Search object.
sourcepub fn search_field<'a>(
&'a self,
field_name: &'a str,
condition: &'a Field
) -> Search<'_>
pub fn search_field<'a>( &'a self, field_name: &'a str, condition: &'a Field ) -> Search<'_>
Create a Search object with the field search set.
sourcepub fn search_activity<'a>(&'a self, condition: Activity) -> Search<'_>
pub fn search_activity<'a>(&'a self, condition: Activity) -> Search<'_>
Create a Search object with the activity search set.
sourcepub fn search_term<'a>(&'a self, condition: Term) -> Search<'_>
pub fn search_term<'a>(&'a self, condition: Term) -> Search<'_>
Create a Search object with the term search set.
sourcepub fn search_row<'a>(&'a self, condition: &'a Number) -> Search<'_>
pub fn search_row<'a>(&'a self, condition: &'a Number) -> Search<'_>
Create a Search object with the row search set.
sourcepub fn search_default(&self) -> Search<'_>
pub fn search_default(&self) -> Search<'_>
Creates a Search object with a default search set. Searches for data whose term is greater than or equal to the current date and time and is active.
source§impl Data
impl Data
sourcepub fn field_names(&self) -> Vec<&String>
pub fn field_names(&self) -> Vec<&String>
Returns a list of field names.
sourcepub fn field_bytes(&self, row: NonZeroU32, name: &str) -> &[u8] ⓘ
pub fn field_bytes(&self, row: NonZeroU32, name: &str) -> &[u8] ⓘ
Returns the value of the field with the specified name in the specified row as a slice.
sourcepub fn field_num(&self, row: NonZeroU32, name: &str) -> f64
pub fn field_num(&self, row: NonZeroU32, name: &str) -> f64
Returns the value of the field with the specified name in the specified row as a number.
source§impl Data
impl Data
sourcepub async fn update(&mut self, operation: Operation) -> Option<NonZeroU32>
pub async fn update(&mut self, operation: Operation) -> Option<NonZeroU32>
Perform operations to register, update, and delete data.
source§impl Data
impl Data
sourcepub fn new<P: AsRef<Path>>(dir: P, option: DataOption) -> Self
pub fn new<P: AsRef<Path>>(dir: P, option: DataOption) -> Self
Opens the file and creates the Data.
sourcepub fn serial(&self, row: NonZeroU32) -> u32
pub fn serial(&self, row: NonZeroU32) -> u32
Returns a serial number.The serial number is incremented each time data is added.
sourcepub fn uuid(&self, row: NonZeroU32) -> Option<u128>
pub fn uuid(&self, row: NonZeroU32) -> Option<u128>
Returns a UUID.UUID is a unique ID that is automatically generated when data is registered..
sourcepub fn uuid_string(&self, row: NonZeroU32) -> Option<String>
pub fn uuid_string(&self, row: NonZeroU32) -> Option<String>
Returns the UUID as a string.
sourcepub fn activity(&self, row: NonZeroU32) -> Option<Activity>
pub fn activity(&self, row: NonZeroU32) -> Option<Activity>
Returns the activity value. activity is used to indicate whether data is valid or invalid.
sourcepub fn term_begin(&self, row: NonZeroU32) -> Option<u64>
pub fn term_begin(&self, row: NonZeroU32) -> Option<u64>
Returns the start date and time of the data’s validity period.
sourcepub fn term_end(&self, row: NonZeroU32) -> Option<u64>
pub fn term_end(&self, row: NonZeroU32) -> Option<u64>
Returns the end date and time of the data’s validity period.
sourcepub fn last_updated(&self, row: NonZeroU32) -> Option<u64>
pub fn last_updated(&self, row: NonZeroU32) -> Option<u64>
Returns the date and time when the data was last updated.