pub struct StateDebug {
registry: Arc<StateRegistry>,
}Expand description
Typed debug handle over the SDK’s state registry: a generic browse across every registered repository, both client-managed and SDK-managed.
Holds a cheap, Arc-backed handle to the registry, so nothing borrows across
the FFI boundary. Reached through the client’s debug tree; bypasses the
type-safe public API.
Fields§
§registry: Arc<StateRegistry>Implementations§
Source§impl StateDebug
impl StateDebug
Sourcepub fn types(&self) -> Vec<String>
pub fn types(&self) -> Vec<String>
Names of every registered repository (client- and SDK-managed).
Sourcepub async fn list(&self, type_name: String) -> String
pub async fn list(&self, type_name: String) -> String
List a repository’s values as a JSON-array string (JSON.parse it),
addressed by type name. Values only (no keys). Raw stored JSON.
Sourcepub async fn get(&self, type_name: String, key: String) -> String
pub async fn get(&self, type_name: String, key: String) -> String
Read one item by type name and string key, as a JSON string ("null" if
absent).
Sourcepub async fn set(&self, type_name: String, key: String, value: String) -> bool
pub async fn set(&self, type_name: String, key: String, value: String) -> bool
Write one item by type name and string key. value is the item as a JSON
string. Returns true if the write landed; false on a bad JSON string,
an unknown type, a bad key, a value that does not deserialize, or a failed
write, so a caller (e.g. a seeding harness) can tell a no-op from a write.
Trait Implementations§
Source§impl FromWasm for StateDebug
Available on crate feature wasm only.
impl FromWasm for StateDebug
wasm only.Source§type Wire = StateDebug
type Wire = StateDebug
Source§fn from_wire(
wire: <StateDebug as FromWasm>::Wire,
) -> Result<StateDebug, WireError>
fn from_wire( wire: <StateDebug as FromWasm>::Wire, ) -> Result<StateDebug, WireError>
Source§impl FromWasmAbi for StateDebug
impl FromWasmAbi for StateDebug
Source§impl IntoWasmAbi for StateDebug
impl IntoWasmAbi for StateDebug
Source§impl LongRefFromWasmAbi for StateDebug
impl LongRefFromWasmAbi for StateDebug
Source§type Anchor = RcRef<StateDebug>
type Anchor = RcRef<StateDebug>
RefFromWasmAbi::AnchorSource§unsafe fn long_ref_from_abi(
js: <StateDebug as LongRefFromWasmAbi>::Abi,
) -> <StateDebug as LongRefFromWasmAbi>::Anchor
unsafe fn long_ref_from_abi( js: <StateDebug as LongRefFromWasmAbi>::Abi, ) -> <StateDebug as LongRefFromWasmAbi>::Anchor
RefFromWasmAbi::ref_from_abiSource§impl OptionFromWasmAbi for StateDebug
impl OptionFromWasmAbi for StateDebug
Source§fn is_none(abi: &<StateDebug as FromWasmAbi>::Abi) -> bool
fn is_none(abi: &<StateDebug as FromWasmAbi>::Abi) -> bool
None, and otherwise it will be passed to
FromWasmAbi.Source§impl OptionIntoWasmAbi for StateDebug
impl OptionIntoWasmAbi for StateDebug
Source§fn none() -> <StateDebug as IntoWasmAbi>::Abi
fn none() -> <StateDebug as IntoWasmAbi>::Abi
None branch of this option. Read moreSource§impl RefFromWasmAbi for StateDebug
impl RefFromWasmAbi for StateDebug
Source§type Anchor = RcRef<StateDebug>
type Anchor = RcRef<StateDebug>
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§unsafe fn ref_from_abi(
js: <StateDebug as RefFromWasmAbi>::Abi,
) -> <StateDebug as RefFromWasmAbi>::Anchor
unsafe fn ref_from_abi( js: <StateDebug as RefFromWasmAbi>::Abi, ) -> <StateDebug as RefFromWasmAbi>::Anchor
Source§impl RefMutFromWasmAbi for StateDebug
impl RefMutFromWasmAbi for StateDebug
Source§type Anchor = RcRefMut<StateDebug>
type Anchor = RcRefMut<StateDebug>
RefFromWasmAbi::AnchorSource§unsafe fn ref_mut_from_abi(
js: <StateDebug as RefMutFromWasmAbi>::Abi,
) -> <StateDebug as RefMutFromWasmAbi>::Anchor
unsafe fn ref_mut_from_abi( js: <StateDebug as RefMutFromWasmAbi>::Abi, ) -> <StateDebug as RefMutFromWasmAbi>::Anchor
RefFromWasmAbi::ref_from_abiSource§impl ToWasm for StateDebug
Available on crate feature wasm only.
impl ToWasm for StateDebug
wasm only.Source§type Wire = StateDebug
type Wire = StateDebug
Source§fn to_wire(self) -> Result<<StateDebug as ToWasm>::Wire, WireError>
fn to_wire(self) -> Result<<StateDebug as ToWasm>::Wire, WireError>
Source§impl TryFromJsValue for StateDebug
impl TryFromJsValue for StateDebug
Source§fn try_from_js_value(value: JsValue) -> Result<StateDebug, JsValue>
fn try_from_js_value(value: JsValue) -> Result<StateDebug, JsValue>
Source§fn try_from_js_value_ref(value: &JsValue) -> Option<StateDebug>
fn try_from_js_value_ref(value: &JsValue) -> Option<StateDebug>
Source§impl VectorFromWasmAbi for StateDebug
impl VectorFromWasmAbi for StateDebug
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi( js: <StateDebug as VectorFromWasmAbi>::Abi, ) -> Box<[StateDebug]>
Source§impl VectorIntoWasmAbi for StateDebug
impl VectorIntoWasmAbi for StateDebug
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi( vector: Box<[StateDebug]>, ) -> <StateDebug as VectorIntoWasmAbi>::Abi
Auto Trait Implementations§
impl !RefUnwindSafe for StateDebug
impl !UnwindSafe for StateDebug
impl Freeze for StateDebug
impl Send for StateDebug
impl Sync for StateDebug
impl Unpin for StateDebug
impl UnsafeUnpin for StateDebug
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Arc<> Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.