pub struct WasmNotesFrontier { /* private fields */ }Expand description
Constant-space append frontier. It retains no leaves or witnesses and emits a shard descriptor only at an exact boundary.
Implementations§
Source§impl WasmNotesFrontier
impl WasmNotesFrontier
pub fn new(depth: u32, shard_height: u32) -> Result<WasmNotesFrontier, JsError>
Sourcepub fn production() -> WasmNotesFrontier
pub fn production() -> WasmNotesFrontier
An empty frontier with the production notes-tree geometry, so callers
stop restating depth = 30 / shardHeight = 14 on the JS side.
pub fn restore(snapshot: &[u8]) -> Result<WasmNotesFrontier, JsError>
pub fn append(&mut self, leaf: &[u8]) -> Result<WasmFrontierAppend, JsError>
pub fn append_many( &mut self, packed_leaves: &[u8], ) -> Result<Vec<WasmCompletedShard>, JsError>
pub fn root(&self) -> Vec<u8> ⓘ
pub fn snapshot(&self) -> Vec<u8> ⓘ
pub fn depth(&self) -> u32
pub fn shard_height(&self) -> u32
pub fn shard_size(&self) -> u32
pub fn leaf_count(&self) -> u32
pub fn shard_count(&self) -> u32
Trait Implementations§
Source§impl From<WasmNotesFrontier> for JsValue
impl From<WasmNotesFrontier> for JsValue
Source§fn from(value: WasmNotesFrontier) -> Self
fn from(value: WasmNotesFrontier) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for WasmNotesFrontier
impl FromWasmAbi for WasmNotesFrontier
Source§impl IntoWasmAbi for WasmNotesFrontier
impl IntoWasmAbi for WasmNotesFrontier
Source§impl LongRefFromWasmAbi for WasmNotesFrontier
impl LongRefFromWasmAbi for WasmNotesFrontier
Source§type Abi = WasmPtr<WasmRefCell<WasmNotesFrontier>>
type Abi = WasmPtr<WasmRefCell<WasmNotesFrontier>>
Same as
RefFromWasmAbi::AbiSource§type Anchor = RcRef<WasmNotesFrontier>
type Anchor = RcRef<WasmNotesFrontier>
Same as
RefFromWasmAbi::AnchorSource§unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
Same as
RefFromWasmAbi::ref_from_abiSource§impl RefFromWasmAbi for WasmNotesFrontier
impl RefFromWasmAbi for WasmNotesFrontier
Source§type Abi = WasmPtr<WasmRefCell<WasmNotesFrontier>>
type Abi = WasmPtr<WasmRefCell<WasmNotesFrontier>>
The Wasm ABI type references to
Self are recovered from.Source§type Anchor = RcRef<WasmNotesFrontier>
type Anchor = RcRef<WasmNotesFrontier>
The type that holds the reference to
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§impl RefMutFromWasmAbi for WasmNotesFrontier
impl RefMutFromWasmAbi for WasmNotesFrontier
Source§type Abi = WasmPtr<WasmRefCell<WasmNotesFrontier>>
type Abi = WasmPtr<WasmRefCell<WasmNotesFrontier>>
Same as
RefFromWasmAbi::AbiSource§type Anchor = RcRefMut<WasmNotesFrontier>
type Anchor = RcRefMut<WasmNotesFrontier>
Same as
RefFromWasmAbi::AnchorSource§unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
Same as
RefFromWasmAbi::ref_from_abiimpl SupportsConstructor for WasmNotesFrontier
impl SupportsInstanceProperty for WasmNotesFrontier
impl SupportsStaticProperty for WasmNotesFrontier
Source§impl TryFromJsValue for WasmNotesFrontier
impl TryFromJsValue for WasmNotesFrontier
Source§impl VectorFromWasmAbi for WasmNotesFrontier
impl VectorFromWasmAbi for WasmNotesFrontier
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[WasmNotesFrontier]>
Source§impl VectorIntoWasmAbi for WasmNotesFrontier
impl VectorIntoWasmAbi for WasmNotesFrontier
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[WasmNotesFrontier]>) -> Self::Abi
Source§impl WasmDescribeVector for WasmNotesFrontier
impl WasmDescribeVector for WasmNotesFrontier
Auto Trait Implementations§
impl Freeze for WasmNotesFrontier
impl RefUnwindSafe for WasmNotesFrontier
impl Send for WasmNotesFrontier
impl Sync for WasmNotesFrontier
impl Unpin for WasmNotesFrontier
impl UnsafeUnpin for WasmNotesFrontier
impl UnwindSafe for WasmNotesFrontier
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
Converts
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> ⓘ
Converts
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 moreimpl<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
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.