Trait penumbra_proto::state::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 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 prefix_proto<'a, P>(
&'a self,
prefix: &'a str
) -> Pin<Box<dyn Stream<Item = Result<(String, P)>> + Send + 'static>>
where P: Message + Default { ... }
}
Available on crate feature
cnidarium
only.Provided Methods§
sourcefn get<D>(&self, key: &str) -> DomainFuture<D, Self::GetRawFut> ⓘ
fn get<D>(&self, key: &str) -> DomainFuture<D, Self::GetRawFut> ⓘ
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 nonverifiable_get<D>(&self, key: &[u8]) -> DomainFuture<D, Self::GetRawFut> ⓘ
fn nonverifiable_get<D>(&self, key: &[u8]) -> DomainFuture<D, Self::GetRawFut> ⓘ
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 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) -> ProtoFuture<P, Self::GetRawFut> ⓘ
fn get_proto<P>(&self, key: &str) -> ProtoFuture<P, Self::GetRawFut> ⓘ
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.
Object Safety§
This trait is not object safe.