Trait chaindexing::Repo

source ·
pub trait Repo: Sync + Send + Migratable + Streamable + ExecutesWithRawQuery + LoadsDataWithRawQuery + Clone {
    type Pool;
    type Conn<'a>;

Show 19 methods // Required methods fn new(url: &str) -> Self; fn get_pool<'life0, 'async_trait>( &'life0 self, max_size: u32 ) -> Pin<Box<dyn Future<Output = Self::Pool> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_conn<'a, 'async_trait>( pool: &'a Self::Pool ) -> Pin<Box<dyn Future<Output = Self::Conn<'a>> + Send + 'async_trait>> where Self: 'async_trait, 'a: 'async_trait; fn run_in_transaction<'a, 'life0, 'async_trait, F>( conn: &'life0 mut Self::Conn<'a>, repo_ops: F ) -> Pin<Box<dyn Future<Output = Result<(), RepoError>> + Send + 'async_trait>> where F: for<'b> FnOnce(&'b mut Self::Conn<'a>) -> BoxFuture<'b, Result<(), RepoError>> + Send + Sync + 'a + 'async_trait, Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait; fn create_contract_addresses<'a, 'life0, 'life1, 'async_trait>( conn: &'life0 mut Self::Conn<'a>, contract_addresses: &'life1 Vec<UnsavedContractAddress> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_all_contract_addresses<'a, 'life0, 'async_trait>( conn: &'life0 mut Self::Conn<'a> ) -> Pin<Box<dyn Future<Output = Vec<ContractAddress>> + Send + 'async_trait>> where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait; fn create_events<'a, 'life0, 'life1, 'async_trait>( conn: &'life0 mut Self::Conn<'a>, events: &'life1 [Event] ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_all_events<'a, 'life0, 'async_trait>( conn: &'life0 mut Self::Conn<'a> ) -> Pin<Box<dyn Future<Output = Vec<Event>> + Send + 'async_trait>> where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait; fn get_events<'a, 'life0, 'async_trait>( conn: &'life0 mut Self::Conn<'a>, address: String, from: u64, to: u64 ) -> Pin<Box<dyn Future<Output = Vec<Event>> + Send + 'async_trait>> where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait; fn delete_events_by_ids<'a, 'life0, 'life1, 'async_trait>( conn: &'life0 mut Self::Conn<'a>, ids: &'life1 Vec<Uuid> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn update_next_block_number_to_ingest_from<'a, 'life0, 'life1, 'async_trait>( conn: &'life0 mut Self::Conn<'a>, contract_address: &'life1 ContractAddress, block_number: i64 ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn update_next_block_number_to_handle_from<'a, 'life0, 'async_trait>( conn: &'life0 mut Self::Conn<'a>, contract_address_id: ContractAddressID, block_number: i64 ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait; fn create_reorged_block<'a, 'life0, 'life1, 'async_trait>( conn: &'life0 mut Self::Conn<'a>, reorged_block: &'life1 UnsavedReorgedBlock ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_unhandled_reorged_blocks<'a, 'life0, 'async_trait>( conn: &'life0 mut Self::Conn<'a> ) -> Pin<Box<dyn Future<Output = Vec<ReorgedBlock>> + Send + 'async_trait>> where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait; fn create_reset_count<'a, 'life0, 'async_trait>( conn: &'life0 mut Self::Conn<'a> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait; fn get_last_reset_count<'a, 'life0, 'async_trait>( conn: &'life0 mut Self::Conn<'a> ) -> Pin<Box<dyn Future<Output = Option<ResetCount>> + Send + 'async_trait>> where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait; fn create_node<'a, 'life0, 'async_trait>( conn: &'life0 mut Self::Conn<'a> ) -> Pin<Box<dyn Future<Output = Node> + Send + 'async_trait>> where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait; fn get_active_nodes<'a, 'life0, 'async_trait>( conn: &'life0 mut Self::Conn<'a>, node_election_rate_ms: u64 ) -> Pin<Box<dyn Future<Output = Vec<Node>> + Send + 'async_trait>> where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait; fn keep_node_active<'a, 'life0, 'life1, 'async_trait>( conn: &'life0 mut Self::Conn<'a>, node: &'life1 Node ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait;
}

Required Associated Types§

source

type Pool

source

type Conn<'a>

Required Methods§

source

fn new(url: &str) -> Self

source

fn get_pool<'life0, 'async_trait>( &'life0 self, max_size: u32 ) -> Pin<Box<dyn Future<Output = Self::Pool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn get_conn<'a, 'async_trait>( pool: &'a Self::Pool ) -> Pin<Box<dyn Future<Output = Self::Conn<'a>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait,

source

fn run_in_transaction<'a, 'life0, 'async_trait, F>( conn: &'life0 mut Self::Conn<'a>, repo_ops: F ) -> Pin<Box<dyn Future<Output = Result<(), RepoError>> + Send + 'async_trait>>
where F: for<'b> FnOnce(&'b mut Self::Conn<'a>) -> BoxFuture<'b, Result<(), RepoError>> + Send + Sync + 'a + 'async_trait, Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

source

fn create_contract_addresses<'a, 'life0, 'life1, 'async_trait>( conn: &'life0 mut Self::Conn<'a>, contract_addresses: &'life1 Vec<UnsavedContractAddress> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn get_all_contract_addresses<'a, 'life0, 'async_trait>( conn: &'life0 mut Self::Conn<'a> ) -> Pin<Box<dyn Future<Output = Vec<ContractAddress>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

source

fn create_events<'a, 'life0, 'life1, 'async_trait>( conn: &'life0 mut Self::Conn<'a>, events: &'life1 [Event] ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn get_all_events<'a, 'life0, 'async_trait>( conn: &'life0 mut Self::Conn<'a> ) -> Pin<Box<dyn Future<Output = Vec<Event>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

source

fn get_events<'a, 'life0, 'async_trait>( conn: &'life0 mut Self::Conn<'a>, address: String, from: u64, to: u64 ) -> Pin<Box<dyn Future<Output = Vec<Event>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

source

fn delete_events_by_ids<'a, 'life0, 'life1, 'async_trait>( conn: &'life0 mut Self::Conn<'a>, ids: &'life1 Vec<Uuid> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn update_next_block_number_to_ingest_from<'a, 'life0, 'life1, 'async_trait>( conn: &'life0 mut Self::Conn<'a>, contract_address: &'life1 ContractAddress, block_number: i64 ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn update_next_block_number_to_handle_from<'a, 'life0, 'async_trait>( conn: &'life0 mut Self::Conn<'a>, contract_address_id: ContractAddressID, block_number: i64 ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

source

fn create_reorged_block<'a, 'life0, 'life1, 'async_trait>( conn: &'life0 mut Self::Conn<'a>, reorged_block: &'life1 UnsavedReorgedBlock ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn get_unhandled_reorged_blocks<'a, 'life0, 'async_trait>( conn: &'life0 mut Self::Conn<'a> ) -> Pin<Box<dyn Future<Output = Vec<ReorgedBlock>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

source

fn create_reset_count<'a, 'life0, 'async_trait>( conn: &'life0 mut Self::Conn<'a> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

source

fn get_last_reset_count<'a, 'life0, 'async_trait>( conn: &'life0 mut Self::Conn<'a> ) -> Pin<Box<dyn Future<Output = Option<ResetCount>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

source

fn create_node<'a, 'life0, 'async_trait>( conn: &'life0 mut Self::Conn<'a> ) -> Pin<Box<dyn Future<Output = Node> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

source

fn get_active_nodes<'a, 'life0, 'async_trait>( conn: &'life0 mut Self::Conn<'a>, node_election_rate_ms: u64 ) -> Pin<Box<dyn Future<Output = Vec<Node>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

source

fn keep_node_active<'a, 'life0, 'life1, 'async_trait>( conn: &'life0 mut Self::Conn<'a>, node: &'life1 Node ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Object Safety§

This trait is not object safe.

Implementors§