Struct versatile_data::Data

source ·
pub struct Data { /* private fields */ }

Implementations§

source§

impl Data

source

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.

source

pub fn result_field(&self, name: &FieldName, condition: &Field) -> RowSet

source§

impl Data

Create a new Search object.

source

pub fn search_field<'a>( &'a self, name: FieldName, condition: &'a Field ) -> Search<'_>

Create a Search object with the field search set.

source

pub fn search_activity<'a>(&'a self, condition: Activity) -> Search<'_>

Create a Search object with the activity search set.

source

pub fn search_term<'a>(&'a self, condition: Term) -> Search<'_>

Create a Search object with the term search set.

source

pub fn search_row<'a>(&'a self, condition: &'a Number) -> Search<'_>

Create a Search object with the row search set.

source

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

source

pub fn field_bytes(&self, row: NonZeroU32, name: &FieldName) -> &[u8]

Returns the value of the field with the specified name in the specified row as a slice.

source

pub fn field_num(&self, row: NonZeroU32, name: &FieldName) -> f64

Returns the value of the field with the specified name in the specified row as a number.

source

pub fn fields(&self) -> &Fields

source§

impl Data

source

pub async fn insert( &mut self, activity: Activity, term_begin: Term, term_end: Term, fields: HashMap<FieldName, Vec<u8>> ) -> NonZeroU32

Delete row.

source

pub async fn update( &mut self, row: NonZeroU32, activity: Activity, term_begin: Term, term_end: Term, fields: HashMap<FieldName, Vec<u8>> )

Update row.

source

pub async fn delete(&mut self, row: NonZeroU32)

Delete row.

source§

impl Data

source

pub fn sort<C: CustomSort>( &self, rows: &RowSet, orders: &[Order<C>] ) -> Vec<NonZeroU32>

Sort search results.

source§

impl Data

source

pub fn new<P: AsRef<Path>>(dir: P, option: DataOption) -> Self

Opens the file and creates the Data.

source

pub fn serial(&self, row: NonZeroU32) -> &u32

Returns a serial number.The serial number is incremented each time data is added.

source

pub fn uuid(&self, row: NonZeroU32) -> Option<&u128>

Returns a UUID.UUID is a unique ID that is automatically generated when data is registered..

source

pub fn uuid_string(&self, row: NonZeroU32) -> Option<String>

Returns the UUID as a string.

source

pub fn activity(&self, row: NonZeroU32) -> Option<Activity>

Returns the activity value. activity is used to indicate whether data is valid or invalid.

source

pub fn term_begin(&self, row: NonZeroU32) -> Option<&u64>

Returns the start date and time of the data’s validity period.

source

pub fn term_end(&self, row: NonZeroU32) -> Option<&u64>

Returns the end date and time of the data’s validity period.

source

pub fn last_updated(&self, row: NonZeroU32) -> Option<&u64>

Returns the date and time when the data was last updated.

source

pub fn all(&self) -> RowSet

Returns all rows.

Auto Trait Implementations§

§

impl RefUnwindSafe for Data

§

impl Send for Data

§

impl Sync for Data

§

impl Unpin for Data

§

impl UnwindSafe for Data

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V