Struct tx_indexer::database::sync_progress::SyncProgressTable
source · pub struct SyncProgressTable {
pub block_slot: i64,
pub block_hash: Vec<u8>,
}
Fields§
§block_slot: i64
§block_hash: Vec<u8>
Implementations§
source§impl SyncProgressTable
impl SyncProgressTable
pub fn new( block_slot: u64, block_hash: String ) -> Result<SyncProgressTable, Error>
sourcepub async fn get(conn: &mut PgConnection) -> Result<Option<Self>, Error>
pub async fn get(conn: &mut PgConnection) -> Result<Option<Self>, Error>
Obtain the sync status of the DB
sourcepub async fn store(&self, conn: &mut PgConnection) -> Result<(), Error>
pub async fn store(&self, conn: &mut PgConnection) -> Result<(), Error>
Save a new entity to the database.
pub async 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<'a, R: Row> FromRow<'a, R> for SyncProgressTable
impl<'a, R: Row> FromRow<'a, R> for SyncProgressTable
source§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 ==
.impl Eq for SyncProgressTable
impl StructuralPartialEq 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
§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.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<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