Struct Collection

Source
pub struct Collection { /* private fields */ }

Implementations§

Source§

impl Collection

Source

pub fn new(data: Data, id: NonZero<i32>, name: impl Into<String>) -> Collection

Source

pub fn id(&self) -> NonZero<i32>

Source

pub fn name(&self) -> &str

Source

pub fn data(&self) -> &Data

Methods from Deref<Target = Data>§

Source

pub fn result_condition<'life0, 'life_self, 'async_recursion>( &'life_self self, condition: &'life0 Condition<'_>, ) -> Pin<Box<dyn Future<Output = BTreeSet<NonZero<u32>>> + 'async_recursion>>
where 'life0: 'async_recursion, 'life_self: 'async_recursion,

Returns search results by specifying Condition.

Source

pub fn result_field( &self, name: &Arc<String>, condition: &Field, ) -> BTreeSet<NonZero<u32>>

Create a new Search object.

Source

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

Create a Search object with the field search set.

Source

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

Create a Search object with the activity search set.

Source

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

Create a Search object with the term search set.

Source

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

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

pub fn field_bytes(&self, row: NonZero<u32>, name: &Arc<String>) -> &[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: NonZero<u32>, name: &Arc<String>) -> f64

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

Source

pub fn fields(&self) -> &HashMap<Arc<String>, IdxBinary>

Source

pub async fn insert( &mut self, activity: Activity, term_begin: Term, term_end: Term, fields: HashMap<Arc<String>, Vec<u8>>, ) -> NonZero<u32>

Delete row.

Source

pub async fn update( &mut self, row: NonZero<u32>, activity: Activity, term_begin: Term, term_end: Term, fields: HashMap<Arc<String>, Vec<u8>>, )

Update row.

Source

pub async fn delete(&mut self, row: NonZero<u32>)

Delete row.

Source

pub fn sort<C>( &self, rows: &BTreeSet<NonZero<u32>>, orders: &[Order<C>], ) -> Vec<NonZero<u32>>
where C: CustomSort,

Sort search results.

Source

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

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

Source

pub fn uuid(&self, row: NonZero<u32>) -> 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: NonZero<u32>) -> Option<String>

Returns the UUID as a string.

Source

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

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

Source

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

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

Source

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

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

Source

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

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

Source

pub fn all(&self) -> BTreeSet<NonZero<u32>>

Returns all rows.

Trait Implementations§

Source§

impl Deref for Collection

Source§

type Target = Data

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<Collection as Deref>::Target

Dereferences the value.
Source§

impl DerefMut for Collection

Source§

fn deref_mut(&mut self) -> &mut <Collection as Deref>::Target

Mutably dereferences the value.

Auto Trait Implementations§

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

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

Source§

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>,

Source§

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.
Source§

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

Source§

fn vzip(self) -> V