penumbra_proto::state

Trait StateReadProto

Source
pub trait StateReadProto:
    StateRead
    + Send
    + Sync {
    // Provided methods
    fn get<D>(&self, key: &str) -> DomainFuture<D, Self::GetRawFut> 
       where D: DomainType + Debug,
             Error: From<<D as TryFrom<D::Proto>>::Error> { ... }
    fn nonverifiable_get<D>(
        &self,
        key: &[u8],
    ) -> DomainFuture<D, Self::GetRawFut> 
       where D: DomainType + Debug,
             Error: From<<D as TryFrom<D::Proto>>::Error> { ... }
    fn get_proto<P>(&self, key: &str) -> ProtoFuture<P, Self::GetRawFut> 
       where P: Message + Default + Debug { ... }
    fn nonverifiable_get_proto<P>(
        &self,
        key: &[u8],
    ) -> ProtoFuture<P, Self::GetRawFut> 
       where P: Message + Default + Debug { ... }
    fn prefix<'a, D>(
        &'a self,
        prefix: &'a str,
    ) -> Pin<Box<dyn Stream<Item = Result<(String, D)>> + Send + 'static>>
       where D: DomainType,
             Error: From<<D as TryFrom<D::Proto>>::Error> { ... }
    fn nonverifiable_prefix<'a, D>(
        &'a self,
        prefix: &[u8],
    ) -> Pin<Box<dyn Stream<Item = Result<(Vec<u8>, D)>> + Send + 'static>>
       where D: DomainType,
             Error: From<<D as TryFrom<D::Proto>>::Error> { ... }
    fn prefix_proto<'a, P>(
        &'a self,
        prefix: &'a str,
    ) -> Pin<Box<dyn Stream<Item = Result<(String, P)>> + Send + 'static>>
       where P: Message + Default { ... }
    fn nonverifiable_prefix_proto<'a, P>(
        &'a self,
        prefix: &'a [u8],
    ) -> Pin<Box<dyn Stream<Item = Result<(Vec<u8>, P)>> + Send + 'static>>
       where P: Message + Default { ... }
}
Available on crate feature cnidarium only.

Provided Methods§

Source

fn get<D>(&self, key: &str) -> DomainFuture<D, Self::GetRawFut>
where D: DomainType + Debug, Error: From<<D as TryFrom<D::Proto>>::Error>,

Gets a value from the verifiable key-value store as a domain type.

§Returns
  • Ok(Some(v)) if the value is present and parseable as a domain type D;
  • Ok(None) if the value is missing;
  • Err(_) if the value is present but not parseable as a domain type D, or if an underlying storage error occurred.
Source

fn nonverifiable_get<D>(&self, key: &[u8]) -> DomainFuture<D, Self::GetRawFut>
where D: DomainType + Debug, Error: From<<D as TryFrom<D::Proto>>::Error>,

Gets a value from the nonverifiable key-value store as a domain type.

§Returns
  • Ok(Some(v)) if the value is present and parseable as a domain type D;
  • Ok(None) if the value is missing;
  • Err(_) if the value is present but not parseable as a domain type D, or if an underlying storage error occurred.
Source

fn get_proto<P>(&self, key: &str) -> ProtoFuture<P, Self::GetRawFut>
where P: Message + Default + Debug,

Gets a value from the verifiable key-value store as a proto type.

§Returns
  • Ok(Some(v)) if the value is present and parseable as a proto type P;
  • Ok(None) if the value is missing;
  • Err(_) if the value is present but not parseable as a proto type P, or if an underlying storage error occurred.
Source

fn nonverifiable_get_proto<P>( &self, key: &[u8], ) -> ProtoFuture<P, Self::GetRawFut>
where P: Message + Default + Debug,

Gets a value from the nonverifiable key-value store as a proto type.

§Returns
  • Ok(Some(v)) if the value is present and parseable as a proto type P;
  • Ok(None) if the value is missing;
  • Err(_) if the value is present but not parseable as a proto type P, or if an underlying storage error occurred.
Source

fn prefix<'a, D>( &'a self, prefix: &'a str, ) -> Pin<Box<dyn Stream<Item = Result<(String, D)>> + Send + 'static>>
where D: DomainType, Error: From<<D as TryFrom<D::Proto>>::Error>,

Retrieve all values for keys matching a prefix from consensus-critical state, as domain types.

Source

fn nonverifiable_prefix<'a, D>( &'a self, prefix: &[u8], ) -> Pin<Box<dyn Stream<Item = Result<(Vec<u8>, D)>> + Send + 'static>>
where D: DomainType, Error: From<<D as TryFrom<D::Proto>>::Error>,

Retrieve all values for keys matching a prefix from nonverifiable storage, as domain types.

Source

fn prefix_proto<'a, P>( &'a self, prefix: &'a str, ) -> Pin<Box<dyn Stream<Item = Result<(String, P)>> + Send + 'static>>
where P: Message + Default,

Retrieve all values for keys matching a prefix from the verifiable key-value store, as proto types.

Source

fn nonverifiable_prefix_proto<'a, P>( &'a self, prefix: &'a [u8], ) -> Pin<Box<dyn Stream<Item = Result<(Vec<u8>, P)>> + Send + 'static>>
where P: Message + Default,

Retrieve all values for keys matching a prefix from the nonverifiable key-value store, as proto types.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§