Struct tx_indexer::database::diesel::sync_progress::SyncProgressTable
source · pub struct SyncProgressTable {
pub block_slot: i64,
pub block_hash: Vec<u8>,
pub processed: bool,
}
Fields§
§block_slot: i64
§block_hash: Vec<u8>
§processed: bool
Implementations§
source§impl SyncProgressTable
impl SyncProgressTable
pub fn new( block_slot: u64, block_hash: String ) -> Result<SyncProgressTable, Error>
sourcepub fn get(conn: &mut PgConnection) -> Result<Option<Self>, Error>
pub fn get(conn: &mut PgConnection) -> Result<Option<Self>, Error>
Obtain the sync status of the DB
sourcepub fn store(&self, conn: &mut PgConnection) -> Result<(), Error>
pub fn store(&self, conn: &mut PgConnection) -> Result<(), Error>
Save a new entity to the database.
pub fn get_or( conn: &mut PgConnection, since_slot: Option<u64>, since_block: Option<String> ) -> Result<Option<(u64, String)>, Error>
Trait Implementations§
source§impl Clone for SyncProgressTable
impl Clone for SyncProgressTable
source§fn clone(&self) -> SyncProgressTable
fn clone(&self) -> SyncProgressTable
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SyncProgressTable
impl Debug for SyncProgressTable
source§impl<'insert> Insertable<table> for &'insert SyncProgressTable
impl<'insert> Insertable<table> for &'insert SyncProgressTable
§type Values = <(Option<Grouped<Eq<block_slot, <&'insert i64 as AsExpression<<block_slot as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<block_hash, <&'insert Vec<u8> as AsExpression<<block_hash as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<processed, <&'insert bool as AsExpression<<processed as Expression>::SqlType>>::Expression>>>) as Insertable<table>>::Values
type Values = <(Option<Grouped<Eq<block_slot, <&'insert i64 as AsExpression<<block_slot as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<block_hash, <&'insert Vec<u8> as AsExpression<<block_hash as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<processed, <&'insert bool as AsExpression<<processed as Expression>::SqlType>>::Expression>>>) as Insertable<table>>::Values
The
VALUES
clause to insert these records Read moresource§fn values(
self
) -> <(Option<Eq<block_slot, &'insert i64>>, Option<Eq<block_hash, &'insert Vec<u8>>>, Option<Eq<processed, &'insert bool>>) as Insertable<table>>::Values
fn values( self ) -> <(Option<Eq<block_slot, &'insert i64>>, Option<Eq<block_hash, &'insert Vec<u8>>>, Option<Eq<processed, &'insert bool>>) as Insertable<table>>::Values
Construct
Self::Values
Read more§fn insert_into(self, table: T) -> InsertStatement<T, Self::Values>where
T: Table,
Self: Sized,
fn insert_into(self, table: T) -> InsertStatement<T, Self::Values>where
T: Table,
Self: Sized,
Insert
self
into a given table. Read moresource§impl Insertable<table> for SyncProgressTable
impl Insertable<table> for SyncProgressTable
§type Values = <(Option<Grouped<Eq<block_slot, <i64 as AsExpression<<block_slot as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<block_hash, <Vec<u8> as AsExpression<<block_hash as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<processed, <bool as AsExpression<<processed as Expression>::SqlType>>::Expression>>>) as Insertable<table>>::Values
type Values = <(Option<Grouped<Eq<block_slot, <i64 as AsExpression<<block_slot as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<block_hash, <Vec<u8> as AsExpression<<block_hash as Expression>::SqlType>>::Expression>>>, Option<Grouped<Eq<processed, <bool as AsExpression<<processed as Expression>::SqlType>>::Expression>>>) as Insertable<table>>::Values
The
VALUES
clause to insert these records Read moresource§fn values(
self
) -> <(Option<Eq<block_slot, i64>>, Option<Eq<block_hash, Vec<u8>>>, Option<Eq<processed, bool>>) as Insertable<table>>::Values
fn values( self ) -> <(Option<Eq<block_slot, i64>>, Option<Eq<block_hash, Vec<u8>>>, Option<Eq<processed, bool>>) as Insertable<table>>::Values
Construct
Self::Values
Read more§fn insert_into(self, table: T) -> InsertStatement<T, Self::Values>where
T: Table,
Self: Sized,
fn insert_into(self, table: T) -> InsertStatement<T, Self::Values>where
T: Table,
Self: Sized,
Insert
self
into a given table. Read moresource§impl PartialEq for SyncProgressTable
impl PartialEq for SyncProgressTable
source§fn eq(&self, other: &SyncProgressTable) -> bool
fn eq(&self, other: &SyncProgressTable) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<__DB: Backend, __ST0, __ST1, __ST2> Queryable<(__ST0, __ST1, __ST2), __DB> for SyncProgressTable
impl<__DB: Backend, __ST0, __ST1, __ST2> Queryable<(__ST0, __ST1, __ST2), __DB> for SyncProgressTable
source§impl<__DB: Backend> Selectable<__DB> for SyncProgressTable
impl<__DB: Backend> Selectable<__DB> for SyncProgressTable
§type SelectExpression = (block_slot, block_hash, processed)
type SelectExpression = (block_slot, block_hash, processed)
The expression you’d like to select. Read more
source§fn construct_selection() -> Self::SelectExpression
fn construct_selection() -> Self::SelectExpression
Construct an instance of the expression
impl Eq for SyncProgressTable
impl StructuralPartialEq for SyncProgressTable
impl UndecoratedInsertRecord<table> for SyncProgressTable
Auto Trait Implementations§
impl Freeze for SyncProgressTable
impl RefUnwindSafe for SyncProgressTable
impl Send for SyncProgressTable
impl Sync for SyncProgressTable
impl Unpin for SyncProgressTable
impl UnwindSafe for SyncProgressTable
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
Mutably borrows from an owned value. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§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>
Converts
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>
Converts
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 moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request
§impl<T> IntoSql for T
impl<T> IntoSql for T
§impl<T, DB> SelectableHelper<DB> for Twhere
T: Selectable<DB>,
DB: Backend,
impl<T, DB> SelectableHelper<DB> for Twhere
T: Selectable<DB>,
DB: Backend,
§fn as_select() -> SelectBy<T, DB>
fn as_select() -> SelectBy<T, DB>
Construct a select clause based on a [
Selectable
] implementation. Read more§fn as_returning() -> SelectBy<Self, DB>
fn as_returning() -> SelectBy<Self, DB>
An alias for
as_select
that can be used with returning clauses§impl<T, ST, DB> StaticallySizedRow<ST, DB> for Twhere
ST: SqlTypeOrSelectable + TupleSize,
T: Queryable<ST, DB>,
DB: Backend,
impl<T, ST, DB> StaticallySizedRow<ST, DB> for Twhere
ST: SqlTypeOrSelectable + TupleSize,
T: Queryable<ST, DB>,
DB: Backend,
§const FIELD_COUNT: usize = <ST as crate::util::TupleSize>::SIZE
const FIELD_COUNT: usize = <ST as crate::util::TupleSize>::SIZE
The number of fields that this type will consume.