Trait penumbra_proto::StateReadProto
source · pub trait StateReadProto: StateRead + Send + Sync {
fn get<D>(
&self,
key: &str
) -> Pin<Box<dyn Future<Output = Result<Option<D>>> + Send + 'static>>
where
D: DomainType + Debug,
<D as TryFrom<D::Proto>>::Error: Into<Error> + Send + Sync + 'static,
{ ... }
fn get_proto<P>(
&self,
key: &str
) -> Pin<Box<dyn Future<Output = Result<Option<P>>> + Send + 'static>>
where
P: Message + Default + Debug,
{ ... }
fn prefix<'a, D>(
&'a self,
prefix: &'a str
) -> Pin<Box<dyn Stream<Item = Result<(String, D)>> + Send + 'a>>
where
D: DomainType,
<D as TryFrom<D::Proto>>::Error: Into<Error> + Send + Sync + 'static,
{ ... }
fn prefix_proto<'a, P>(
&'a self,
prefix: &'a str
) -> Pin<Box<dyn Stream<Item = Result<(String, P)>> + Send + 'a>>
where
P: Message + Default,
{ ... }
}
Provided Methods§
sourcefn get<D>(
&self,
key: &str
) -> Pin<Box<dyn Future<Output = Result<Option<D>>> + Send + 'static>>where
D: DomainType + Debug,
<D as TryFrom<D::Proto>>::Error: Into<Error> + Send + Sync + 'static,
fn get<D>(
&self,
key: &str
) -> Pin<Box<dyn Future<Output = Result<Option<D>>> + Send + 'static>>where
D: DomainType + Debug,
<D as TryFrom<D::Proto>>::Error: Into<Error> + Send + Sync + 'static,
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 typeD
;Ok(None)
if the value is missing;Err(_)
if the value is present but not parseable as a domain typeD
, or if an underlying storage error occurred.
sourcefn get_proto<P>(
&self,
key: &str
) -> Pin<Box<dyn Future<Output = Result<Option<P>>> + Send + 'static>>where
P: Message + Default + Debug,
fn get_proto<P>(
&self,
key: &str
) -> Pin<Box<dyn Future<Output = Result<Option<P>>> + Send + 'static>>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 typeP
;Ok(None)
if the value is missing;Err(_)
if the value is present but not parseable as a proto typeP
, or if an underlying storage error occurred.