[][src]Struct grin_servers::common::adapters::NetToChainAdapter

pub struct NetToChainAdapter { /* fields omitted */ }

Implementation of the NetAdapter for the . Gets notified when new blocks and transactions are received and forwards to the chain and pool implementations.

Methods

impl NetToChainAdapter[src]

pub fn new(
    sync_state: Arc<SyncState>,
    chain: Arc<Chain>,
    tx_pool: Arc<RwLock<TransactionPool>>,
    verifier_cache: Arc<RwLock<dyn VerifierCache>>,
    config: ServerConfig
) -> NetToChainAdapter
[src]

Construct a new NetToChainAdapter instance

pub fn init(&self, peers: Arc<Peers>)[src]

Initialize a NetToChainAdaptor with reference to a Peers object. Should only be called once.

Trait Implementations

impl ChainAdapter for NetToChainAdapter[src]

fn get_block(&self, h: Hash) -> Option<Block>[src]

Gets a full block by its hash.

fn txhashset_read(&self, h: Hash) -> Option<TxHashSetRead>[src]

Provides a reading view into the current txhashset state as well as the required indexes for a consumer to rewind to a consistent state at the provided block hash.

fn txhashset_write(
    &self,
    h: Hash,
    txhashset_data: File,
    _peer_addr: PeerAddr
) -> bool
[src]

Writes a reading view on a txhashset state that's been provided to us. If we're willing to accept that new state, the data stream will be read as a zip file, unzipped and the resulting state files should be rewound to the provided indexes.

Auto Trait Implementations

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Erased for T

impl<T> UnsafeAny for T where
    T: Any

impl<T> SafeBorrow for T where
    T: ?Sized

impl<T> Same for T

type Output = T

Should always be Self