[][src]Trait eosio_cdt::PrimaryTableIndexExt

pub trait PrimaryTableIndexExt<'a, T>: TableIndex<'a, u64, T, Cursor = PrimaryTableCursor<T>> where
    T: Table + 'a, 
{ fn begin(&'a self) -> Option<Self::Cursor> { ... }
fn iter(&'a self) -> PrimaryTableIterator<T> { ... }
fn count(&'a self) -> usize { ... }
fn exists<Id>(&'a self, id: Id) -> bool
    where
        Id: Into<u64>
, { ... }
fn end(&'a self) -> i32 { ... }
fn find<Id>(&'a self, id: Id) -> Option<PrimaryTableCursor<T>>
    where
        Id: Into<u64>
, { ... }
fn available_primary_key(&'a self) -> Option<u64> { ... } }

Trait for functions of a PrimaryTableIndex that only apply within a smart contract

Provided methods

fn begin(&'a self) -> Option<Self::Cursor>

Returns the first row in the table

Important traits for PrimaryTableIterator<T>
fn iter(&'a self) -> PrimaryTableIterator<T>

Iterate over rows in the table

fn count(&'a self) -> usize

Total number of rows in the table

fn exists<Id>(&'a self, id: Id) -> bool where
    Id: Into<u64>, 

Returns true if the table contains a row with the specified primary key

fn end(&'a self) -> i32

Returns the last row in the table

fn find<Id>(&'a self, id: Id) -> Option<PrimaryTableCursor<T>> where
    Id: Into<u64>, 

Returns a cursor pointing to a row with the specified primary key, if it exists

fn available_primary_key(&'a self) -> Option<u64>

Gets the next available primary key

Loading content...

Implementations on Foreign Types

impl<'a, T> PrimaryTableIndexExt<'a, T> for PrimaryTableIndex<T> where
    T: Table + 'a, 
[src]

Loading content...

Implementors

Loading content...