pub struct ReproducibleWasmCodec<E: WasmEngine>{ /* private fields */ }
Expand description
Codec instantiated inside a WebAssembly component.
The codec is loaded such that its execution is reproducible across any platform. Importantly, each codec owns its own component instance such that two codecs cannot interfere.
Implementations§
Source§impl<E: WasmEngine> ReproducibleWasmCodec<E>
impl<E: WasmEngine> ReproducibleWasmCodec<E>
Sourcepub fn try_drop(self) -> Result<(), ReproducibleWasmCodecError>
pub fn try_drop(self) -> Result<(), ReproducibleWasmCodecError>
Sourcepub fn instruction_counter(
&self,
) -> Result<Wrapping<u64>, ReproducibleWasmCodecError>
pub fn instruction_counter( &self, ) -> Result<Wrapping<u64>, ReproducibleWasmCodecError>
Read the codec’s instruction counter, which is based on the number of WebAssembly bytecode instructions executed.
The instruction counter is never reset and wraps around. Comparisons of
the counter values before and after, e.g. a call to Self::encode
,
should thus use wrapping arithmetic.
§Errors
Errors if interacting with the component fails.
Trait Implementations§
Source§impl<E: WasmEngine> Clone for ReproducibleWasmCodec<E>
impl<E: WasmEngine> Clone for ReproducibleWasmCodec<E>
Source§impl<E: WasmEngine> Codec for ReproducibleWasmCodec<E>
impl<E: WasmEngine> Codec for ReproducibleWasmCodec<E>
Source§fn encode(&self, data: AnyCowArray<'_>) -> Result<AnyArray, Self::Error>
fn encode(&self, data: AnyCowArray<'_>) -> Result<AnyArray, Self::Error>
Encodes the
data
and returns the result. Read moreSource§fn decode(&self, encoded: AnyCowArray<'_>) -> Result<AnyArray, Self::Error>
fn decode(&self, encoded: AnyCowArray<'_>) -> Result<AnyArray, Self::Error>
Decodes the
encoded
data and returns the result. Read moreSource§fn decode_into(
&self,
encoded: AnyArrayView<'_>,
decoded: AnyArrayViewMut<'_>,
) -> Result<(), Self::Error>
fn decode_into( &self, encoded: AnyArrayView<'_>, decoded: AnyArrayViewMut<'_>, ) -> Result<(), Self::Error>
Source§impl<E: WasmEngine> Drop for ReproducibleWasmCodec<E>
impl<E: WasmEngine> Drop for ReproducibleWasmCodec<E>
Source§impl<E: WasmEngine> DynCodec for ReproducibleWasmCodec<E>
impl<E: WasmEngine> DynCodec for ReproducibleWasmCodec<E>
Source§type Type = ReproducibleWasmCodecType<E>
type Type = ReproducibleWasmCodecType<E>
Type object type for this codec.
Source§fn get_config<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>
fn get_config<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>
Serializes the configuration parameters for this codec. Read more
Auto Trait Implementations§
impl<E> !Freeze for ReproducibleWasmCodec<E>
impl<E> !RefUnwindSafe for ReproducibleWasmCodec<E>
impl<E> Send for ReproducibleWasmCodec<E>
impl<E> Sync for ReproducibleWasmCodec<E>
impl<E> Unpin for ReproducibleWasmCodec<E>
impl<E> !UnwindSafe for ReproducibleWasmCodec<E>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more