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

source

pub fn new( block_slot: u64, block_hash: String ) -> Result<SyncProgressTable, Error>

source

pub fn get(conn: &mut PgConnection) -> Result<Option<Self>, Error>

Obtain the sync status of the DB

source

pub fn store(&self, conn: &mut PgConnection) -> Result<(), Error>

Save a new entity to the database.

source

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

source§

fn clone(&self) -> SyncProgressTable

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SyncProgressTable

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

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

The VALUES clause to insert these records Read more
source§

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,

Insert self into a given table. Read more
source§

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

The VALUES clause to insert these records Read more
source§

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,

Insert self into a given table. Read more
source§

impl PartialEq for SyncProgressTable

source§

fn eq(&self, other: &SyncProgressTable) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<__DB: Backend, __ST0, __ST1, __ST2> Queryable<(__ST0, __ST1, __ST2), __DB> for SyncProgressTable
where (i64, Vec<u8>, bool): FromStaticSqlRow<(__ST0, __ST1, __ST2), __DB>,

§

type Row = (i64, Vec<u8>, bool)

The Rust type you’d like to map from. Read more
source§

fn build(row: Self::Row) -> Result<Self>

Construct an instance of this type
source§

impl<__DB: Backend> Selectable<__DB> for SyncProgressTable

§

type SelectExpression = (block_slot, block_hash, processed)

The expression you’d like to select. Read more
source§

fn construct_selection() -> Self::SelectExpression

Construct an instance of the expression
source§

impl Eq for SyncProgressTable

source§

impl StructuralPartialEq for SyncProgressTable

source§

impl UndecoratedInsertRecord<table> for SyncProgressTable

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> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

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
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

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
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> IntoSql for T

§

fn into_sql<T>(self) -> Self::Expression
where Self: Sized + AsExpression<T>, T: SqlType + TypedExpressionType,

Convert self to an expression for Diesel’s query builder. Read more
§

fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
where &'a Self: AsExpression<T>, T: SqlType + TypedExpressionType,

Convert &self to an expression for Diesel’s query builder. Read more
§

impl<T, DB> SelectableHelper<DB> for T
where T: Selectable<DB>, DB: Backend,

§

fn as_select() -> SelectBy<T, DB>

Construct a select clause based on a [Selectable] implementation. Read more
§

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 T
where ST: SqlTypeOrSelectable + TupleSize, T: Queryable<ST, DB>, DB: Backend,

§

const FIELD_COUNT: usize = <ST as crate::util::TupleSize>::SIZE

The number of fields that this type will consume.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> ToPLA<U> for T
where U: FromCSL<T>,

§

fn to_pla(&self) -> U

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<T, U> TryToCSL<U> for T
where U: TryFromPLA<T>,

§

fn try_to_csl(&self) -> Result<U, TryFromPLAError>

§

impl<T, U> TryToPLA<U> for T
where U: TryFromCSL<T>,

§

fn try_to_pla(&self) -> Result<U, TryFromCSLError>

§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more