Struct StateDebug
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§
§impl StateDebug
impl StateDebug
pub 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.
pub 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).
pub 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§
§impl FromWasm for StateDebug
Available on crate feature wasm only.
impl FromWasm for StateDebug
wasm only.§type Wire = StateDebug
type Wire = StateDebug
§fn from_wire(
wire: <StateDebug as FromWasm>::Wire,
) -> Result<StateDebug, WireError>
fn from_wire( wire: <StateDebug as FromWasm>::Wire, ) -> Result<StateDebug, WireError>
§impl FromWasmAbi for StateDebug
impl FromWasmAbi for StateDebug
§type Abi = WasmPtr<WasmRefCell<StateDebug>>
type Abi = WasmPtr<WasmRefCell<StateDebug>>
§unsafe fn from_abi(js: <StateDebug as FromWasmAbi>::Abi) -> StateDebug
unsafe fn from_abi(js: <StateDebug as FromWasmAbi>::Abi) -> StateDebug
§impl IntoWasmAbi for StateDebug
impl IntoWasmAbi for StateDebug
§type Abi = WasmPtr<WasmRefCell<StateDebug>>
type Abi = WasmPtr<WasmRefCell<StateDebug>>
§fn into_abi(self) -> <StateDebug as IntoWasmAbi>::Abi
fn into_abi(self) -> <StateDebug as IntoWasmAbi>::Abi
self into Self::Abi so that it can be sent across the wasm
ABI boundary.§impl LongRefFromWasmAbi for StateDebug
impl LongRefFromWasmAbi for StateDebug
§type Abi = WasmPtr<WasmRefCell<StateDebug>>
type Abi = WasmPtr<WasmRefCell<StateDebug>>
RefFromWasmAbi::Abi§type Anchor = RcRef<StateDebug>
type Anchor = RcRef<StateDebug>
RefFromWasmAbi::Anchor§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_abi§impl NullableFromWasmAbi for StateDebug
impl NullableFromWasmAbi for StateDebug
§fn is_null(abi: &<StateDebug as MaybeFromWasmAbi>::MaybeAbi) -> bool
fn is_null(abi: &<StateDebug as MaybeFromWasmAbi>::MaybeAbi) -> bool
Nullable::Null.§impl NullableIntoWasmAbi for StateDebug
impl NullableIntoWasmAbi for StateDebug
§fn null() -> <StateDebug as MaybeIntoWasmAbi>::MaybeAbi
fn null() -> <StateDebug as MaybeIntoWasmAbi>::MaybeAbi
§impl OptionFromWasmAbi for StateDebug
impl OptionFromWasmAbi for StateDebug
§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.§impl OptionIntoWasmAbi for StateDebug
impl OptionIntoWasmAbi for StateDebug
§fn none() -> <StateDebug as IntoWasmAbi>::Abi
fn none() -> <StateDebug as IntoWasmAbi>::Abi
None branch of this option. Read more§impl RefFromWasmAbi for StateDebug
impl RefFromWasmAbi for StateDebug
§type Abi = WasmPtr<WasmRefCell<StateDebug>>
type Abi = WasmPtr<WasmRefCell<StateDebug>>
Self are recovered from.§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.§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
§impl RefMutFromWasmAbi for StateDebug
impl RefMutFromWasmAbi for StateDebug
§type Abi = WasmPtr<WasmRefCell<StateDebug>>
type Abi = WasmPtr<WasmRefCell<StateDebug>>
RefFromWasmAbi::Abi§type Anchor = RcRefMut<StateDebug>
type Anchor = RcRefMut<StateDebug>
RefFromWasmAbi::Anchor§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_abi§impl ToWasm for StateDebug
Available on crate feature wasm only.
impl ToWasm for StateDebug
wasm only.§type Wire = StateDebug
type Wire = StateDebug
§fn to_wire(self) -> Result<<StateDebug as ToWasm>::Wire, WireError>
fn to_wire(self) -> Result<<StateDebug as ToWasm>::Wire, WireError>
§impl TryFromJsValue for StateDebug
impl TryFromJsValue for StateDebug
§fn try_from_js_value(value: JsValue) -> Result<StateDebug, JsValue>
fn try_from_js_value(value: JsValue) -> Result<StateDebug, JsValue>
§fn try_from_js_value_ref(value: &JsValue) -> Option<StateDebug>
fn try_from_js_value_ref(value: &JsValue) -> Option<StateDebug>
Source§const NULLABLE: bool = false
const NULLABLE: bool = false
Self accepts null as a distinct value space, as
Nullable<T> does. An enclosing Option then passes null through
instead of reading it as None, so Option<T> is itself nullable
exactly when T is not. JsValue does not set this: it accepts
null as one value among all of them, not as a distinct space, and
Option<JsValue> reads it as None like the ABI does. This is the
JS-value side of NullableFromWasmAbi, which claims null at the
ABI.§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]>
§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 moreSource§impl<T> MaybeFromWasmAbi for Twhere
T: OptionFromWasmAbi,
impl<T> MaybeFromWasmAbi for Twhere
T: OptionFromWasmAbi,
Source§type MaybeAbi = <T as FromWasmAbi>::Abi
type MaybeAbi = <T as FromWasmAbi>::Abi
Option<Self>.Source§unsafe fn from_maybe_abi(js: <T as FromWasmAbi>::Abi) -> T
unsafe fn from_maybe_abi(js: <T as FromWasmAbi>::Abi) -> T
unsafe fn try_from_maybe_abi( js: <T as FromWasmAbi>::Abi, ) -> Result<T, &'static str>
Source§impl<T> MaybeIntoWasmAbi for Twhere
T: OptionIntoWasmAbi,
impl<T> MaybeIntoWasmAbi for Twhere
T: OptionIntoWasmAbi,
Source§type MaybeAbi = <T as IntoWasmAbi>::Abi
type MaybeAbi = <T as IntoWasmAbi>::Abi
Option<Self>.Source§fn into_maybe_abi(self) -> <T as IntoWasmAbi>::Abi
fn into_maybe_abi(self) -> <T as IntoWasmAbi>::Abi
Option<Self> ABI.§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.